mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2025-04-21 12:27:27 +03:00
tools: atrf-id option -s to retrieve driver spec, with necessary infrastructure
- include/atrf.h (atrf_driver_spec), lib/atrf.c (atrf_driver_spec): new function to retrieve the local or remote/final driver spec - lib/atrf.c (struct atrf_dsc, atrf_open, atrf_close): record the local driver spec - lib/driver.h (struct atrf_driver): new driver function "driver_spec" to retrieve the driver spec - lib/atnet.c (struct atnet_dsc, atnet_open, atnet_close): maintain a cache for the driver spec - lib/atnet.c (atnet_driver_spec, atnet_driver): added support for the "driver_spec" function - atrf-proxy/PROTOCOL, atrf-proxy/atrf-proxy.c (cmd_zero): added command SPEC to retrieve the (final) driver spec - atrf-id/atrf-id.c (usage, main): added option -s to retrieve the driver spec. One -s retrieves the local spec, -s -s the remote/final.
This commit is contained in:
@@ -151,6 +151,15 @@ static int cmd_zero(struct atrf_dsc *dsc, struct netio *netio, const char *cmd)
|
||||
{
|
||||
int res;
|
||||
|
||||
if (!strcasecmp(cmd, "spec")) {
|
||||
const char *spec = atrf_driver_spec(dsc, 1);
|
||||
|
||||
if (spec)
|
||||
return netio_printf(netio, "+%s\n", spec);
|
||||
else
|
||||
return netio_printf(netio,
|
||||
"-can't obtain specification\n");
|
||||
}
|
||||
if (!strcasecmp(cmd, "reset")) {
|
||||
atrf_reset(dsc);
|
||||
return netio_printf(netio, "+\n");
|
||||
|
||||
Reference in New Issue
Block a user