posix-h4: don't print local name if read command failed

This commit is contained in:
Matthias Ringwald 2016-12-02 11:45:08 +01:00
parent f511cefa8c
commit 32d5309e57

View File

@ -89,6 +89,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
break;
case HCI_EVENT_COMMAND_COMPLETE:
if (HCI_EVENT_IS_COMMAND_COMPLETE(packet, hci_read_local_name)){
if (hci_event_command_complete_get_return_parameters(packet)[0]) break;
// terminate, name 248 chars
packet[6+248] = 0;
printf("Local name: %s\n", &packet[6]);