Changes in uspace/app/mixerctl/mixerctl.c [5b77efc:7d276395] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/mixerctl/mixerctl.c
r5b77efc r7d276395 35 35 #include <assert.h> 36 36 #include <errno.h> 37 #include <loc.h> 37 38 #include <str_error.h> 38 39 #include <str.h> 39 #include <devman.h>40 40 #include <audio_mixer_iface.h> 41 41 #include <stdio.h> 42 42 43 #define DEFAULT_ DEVICE "/hw/pci0/00:01.0/sb16/control"43 #define DEFAULT_SERVICE "devices/\\hw\\pci0\\00:01.0\\sb16\\control" 44 44 45 45 /** … … 128 128 int main(int argc, char *argv[]) 129 129 { 130 const char * device = DEFAULT_DEVICE;130 const char *service = DEFAULT_SERVICE; 131 131 void (*command)(async_exch_t *, int, char*[]) = NULL; 132 132 … … 134 134 command = set_level; 135 135 if (argc == 5) 136 device = argv[1];136 service = argv[1]; 137 137 } 138 138 … … 140 140 command = get_level; 141 141 if (argc == 4) 142 device = argv[1];142 service = argv[1]; 143 143 } 144 144 145 145 if ((argc == 2 && command == NULL)) 146 device = argv[1];146 service = argv[1]; 147 147 148 148 149 devman_handle_t mixer_handle;150 int r et = devman_fun_get_handle(device, &mixer_handle, 0);151 if (r et!= 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)); 154 154 return 1; 155 155 } 156 156 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); 159 159 if (!session) { 160 printf("Failed to connect to device.\n");160 printf("Failed connecting mixer service '%s'.\n", service); 161 161 return 1; 162 162 }
Note:
See TracChangeset
for help on using the changeset viewer.