Using uint8_t for buffers instead of char
This commit is contained in:
parent
401a4150e6
commit
1c478c73e8
4
main.c
4
main.c
|
@ -34,7 +34,7 @@ static int setpassword(const char *password)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("Updating password to `%s'... ", password);
|
printf("Updating password to `%s'... ", password);
|
||||||
if (send_command(ACTIONPRO_OPCODE_SETPASSWORD, password, slen) == ACTIONPRO_CMD_OK)
|
if (send_command(ACTIONPRO_OPCODE_SETPASSWORD, (const uint8_t *)password, slen) == ACTIONPRO_CMD_OK)
|
||||||
printf("OK\n");
|
printf("OK\n");
|
||||||
else
|
else
|
||||||
printf("ERROR\n");
|
printf("ERROR\n");
|
||||||
|
@ -61,7 +61,7 @@ static int setssid(const char *ssid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("Updating SSID to `%s'... ", ssid);
|
printf("Updating SSID to `%s'... ", ssid);
|
||||||
if (send_command(ACTIONPRO_OPCODE_SETSSID, ssid, slen) == ACTIONPRO_CMD_OK)
|
if (send_command(ACTIONPRO_OPCODE_SETSSID, (const uint8_t *)ssid, slen) == ACTIONPRO_CMD_OK)
|
||||||
printf("OK\n");
|
printf("OK\n");
|
||||||
else
|
else
|
||||||
printf("ERROR\n");
|
printf("ERROR\n");
|
||||||
|
|
2
usbms.c
2
usbms.c
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
static struct libusb_device_handle *handle = NULL;
|
static struct libusb_device_handle *handle = NULL;
|
||||||
|
|
||||||
int send_command(const uint8_t opcode, const char *buf, const uint8_t buflen)
|
int send_command(const uint8_t opcode, const uint8_t *buf, const uint8_t buflen)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
uint32_t expected_tag = 0;
|
uint32_t expected_tag = 0;
|
||||||
|
|
2
usbms.h
2
usbms.h
|
@ -27,6 +27,6 @@
|
||||||
/* exported functions */
|
/* exported functions */
|
||||||
extern int open_device();
|
extern int open_device();
|
||||||
extern int close_device();
|
extern int close_device();
|
||||||
extern int send_command(const uint8_t opcode, const char *buf, const uint8_t buflen);
|
extern int send_command(const uint8_t opcode, const uint8_t *buf, const uint8_t buflen);
|
||||||
|
|
||||||
#endif /* usbms_h */
|
#endif /* usbms_h */
|
||||||
|
|
Loading…
Reference in New Issue