Using uint8_t for buffers instead of char

This commit is contained in:
jpk 2021-08-16 14:21:31 +02:00
parent 401a4150e6
commit 1c478c73e8
3 changed files with 4 additions and 4 deletions

4
main.c
View File

@ -34,7 +34,7 @@ static int setpassword(const char *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");
else
printf("ERROR\n");
@ -61,7 +61,7 @@ static int setssid(const char *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");
else
printf("ERROR\n");

View File

@ -34,7 +34,7 @@
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;
uint32_t expected_tag = 0;

View File

@ -27,6 +27,6 @@
/* exported functions */
extern int open_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 */