Changeset 15d0046 in mainline for uspace/app/mixerctl/mixerctl.c


Ignore:
Timestamp:
2014-09-12T13:22:33Z (10 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9b20126
Parents:
8db09e4 (diff), 105d8d6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

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

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