Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/mixerctl/mixerctl.c

    r7d276395 r5b77efc  
    3535#include <assert.h>
    3636#include <errno.h>
    37 #include <loc.h>
    3837#include <str_error.h>
    3938#include <str.h>
     39#include <devman.h>
    4040#include <audio_mixer_iface.h>
    4141#include <stdio.h>
    4242
    43 #define DEFAULT_SERVICE "devices/\\hw\\pci0\\00:01.0\\sb16\\control"
     43#define DEFAULT_DEVICE "/hw/pci0/00:01.0/sb16/control"
    4444
    4545/**
     
    128128int main(int argc, char *argv[])
    129129{
    130         const char *service = DEFAULT_SERVICE;
     130        const char *device = DEFAULT_DEVICE;
    131131        void (*command)(async_exch_t *, int, char*[]) = NULL;
    132132
     
    134134                command = set_level;
    135135                if (argc == 5)
    136                         service = argv[1];
     136                        device = argv[1];
    137137        }
    138138
     
    140140                command = get_level;
    141141                if (argc == 4)
    142                         service = argv[1];
     142                        device = argv[1];
    143143        }
    144144
    145145        if ((argc == 2 && command == NULL))
    146                 service = argv[1];
     146                device = argv[1];
    147147
    148148
    149         service_id_t mixer_sid;
    150         int rc = loc_service_get_id(service, &mixer_sid, 0);
    151         if (rc != EOK) {
    152                 printf("Failed to resolve service '%s': %s.\n",
    153                     service, str_error(rc));
     149        devman_handle_t mixer_handle;
     150        int ret = devman_fun_get_handle(device, &mixer_handle, 0);
     151        if (ret != EOK) {
     152                printf("Failed to get device(%s) handle: %s.\n",
     153                    device, str_error(ret));
    154154                return 1;
    155155        }
    156156
    157         async_sess_t *session = loc_service_connect(
    158             EXCHANGE_ATOMIC, mixer_sid, 0);
     157        async_sess_t *session = devman_device_connect(
     158            EXCHANGE_ATOMIC, mixer_handle, IPC_FLAG_BLOCKING);
    159159        if (!session) {
    160                 printf("Failed connecting mixer service '%s'.\n", service);
     160                printf("Failed to connect to device.\n");
    161161                return 1;
    162162        }
Note: See TracChangeset for help on using the changeset viewer.