Skip to content

Commit 8642180

Browse files
authored
Merge pull request #3 from MicrochipTech/bugfix/uuid-lsb
Updated the UUID transmission to LSB first
2 parents 69e5019 + 55c20cb commit 8642180

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

lib/mfg.c

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,6 @@ int sjtag_debug_token_gen(uint8_t *idcode_ptr, uint8_t *uuid_ptr, uint8_t *suv_p
10051005
int socket_server;
10061006
struct sockaddr_in server_address;
10071007
uint8_t sjtag_hmac_msg[SJTAG_HMAC_MSG_LEN] = {0};
1008-
uint8_t sjtag_uuid_send[SJTAG_UUID_LEN] = {0};
10091008
uint8_t sjtag_idcode_send[SJTAG_IDCODE_LEN] = {0};
10101009
const uint8_t unlock_str[SJTAG_UNLOCK_STR_LEN] = {'S','T','M','F','D','_','S','J','T','A','G','_','U','N','L','O','C','K'};
10111010
uint8_t cmd_header[SJTAG_SERVER_HEADER_LEN];
@@ -1067,21 +1066,17 @@ int sjtag_debug_token_gen(uint8_t *idcode_ptr, uint8_t *uuid_ptr, uint8_t *suv_p
10671066
}
10681067

10691068
if(true == verbose)
1070-
printf("UUID: ");
1071-
1072-
for(int i=0; i<SJTAG_UUID_LEN; i++)
1073-
{
1074-
sjtag_uuid_send[i] = uuid_ptr[9 - i];
1075-
if(true == verbose)
1076-
{
1077-
printf("%x", sjtag_uuid_send[i]);
1078-
}
1079-
}
1080-
if(true == verbose)
1081-
printf("\n");
1069+
{
1070+
printf("UUID: ");
1071+
for(int i=0; i<SJTAG_UUID_LEN; i++)
1072+
{
1073+
printf("%x", uuid_ptr[i]);
1074+
}
1075+
printf("\n");
1076+
}
10821077

10831078
/* Send the UUID to the server */
1084-
if(send(socket_server, sjtag_uuid_send, SJTAG_UUID_LEN, 0) < 0)
1079+
if(send(socket_server, uuid_ptr, SJTAG_UUID_LEN, 0) < 0)
10851080
{
10861081
printf("Unable to send the UUID to the Plugin server!\n");
10871082
ret = -1;

0 commit comments

Comments
 (0)