Skip to content
Permalink
Browse files

MISRAC2012-Rule-8.9: inline const objects that are used by single fun…

…ction
  • Loading branch information
mringwal committed Jan 17, 2020
1 parent b15ccad commit 8334d3d848d4b982e94c50bb19c1186089449d05
@@ -368,7 +368,7 @@ typedef struct EccPoint {
} EccPoint;

static const uECC_word_t curve_p[uECC_WORDS] = uECC_CONCAT(Curve_P_, uECC_CURVE);
static const uECC_word_t curve_b[uECC_WORDS] = uECC_CONCAT(Curve_B_, uECC_CURVE);
// Global object `curve_b' is only referenced from function `curve_x_side', it should be defined within that functions block scope
static const EccPoint curve_G = uECC_CONCAT(Curve_G_, uECC_CURVE);
static const uECC_word_t curve_n[uECC_N_WORDS] = uECC_CONCAT(Curve_N_, uECC_CURVE);

@@ -2083,6 +2083,7 @@ void uECC_compress(const uint8_t public_key[uECC_BYTES*2], uint8_t compressed[uE

/* Computes result = x^3 + ax + b. result must not overlap x. */
static void curve_x_side(uECC_word_t * RESTRICT result, const uECC_word_t * RESTRICT x) {
static const uECC_word_t curve_b[uECC_WORDS] = uECC_CONCAT(Curve_B_, uECC_CURVE);
#if (uECC_CURVE == uECC_secp256k1)
vli_modSquare_fast(result, x); /* r = x^2 */
vli_modMult_fast(result, result, x); /* r = x^3 */
@@ -72,21 +72,6 @@ typedef enum {
TC_W4_DISCONNECT
} tc_state_t;

static const char * ancs_attribute_names[] = {
"AppIdentifier",
"IDTitle",
"IDSubtitle",
"IDMessage",
"IDMessageSize",
"IDDate"
};
static const int ANCS_ATTRBUTE_NAMES_COUNT = sizeof(ancs_attribute_names) / sizeof(char *);

static const uint8_t ancs_service_uuid[] = {0x79,0x05,0xF4,0x31,0xB5,0xCE,0x4E,0x99,0xA4,0x0F,0x4B,0x1E,0x12,0x2D,0x00,0xD0};
static const uint8_t ancs_notification_source_uuid[] = {0x9F,0xBF,0x12,0x0D,0x63,0x01,0x42,0xD9,0x8C,0x58,0x25,0xE6,0x99,0xA2,0x1D,0xBD};
static const uint8_t ancs_control_point_uuid[] = {0x69,0xD1,0xD8,0xF3,0x45,0xE1,0x49,0xA8,0x98,0x21,0x9B,0xBD,0xFD,0xAA,0xD9,0xD9};
static const uint8_t ancs_data_source_uuid[] = {0x22,0xEA,0xC6,0xE9,0x24,0xD6,0x4B,0xB5,0xBE,0x44,0xB3,0x6A,0xCE,0x7C,0x7B,0xFB};

static uint32_t ancs_notification_uid;
static uint16_t gc_handle;
static gatt_client_notification_t ancs_notification_source_notification;
@@ -144,6 +129,17 @@ static void ancs_chunk_parser_init(void){
}

const char * ancs_client_attribute_name_for_id(int id){
static const char * ancs_attribute_names[] = {
"AppIdentifier",
"IDTitle",
"IDSubtitle",
"IDMessage",
"IDMessageSize",
"IDDate"
};

static const uint16_t ANCS_ATTRBUTE_NAMES_COUNT = sizeof(ancs_attribute_names) / sizeof(char *);

if (id >= ANCS_ATTRBUTE_NAMES_COUNT) return NULL;
return ancs_attribute_names[id];
}
@@ -185,6 +181,12 @@ static void handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *pac
UNUSED(channel); // ok: there is no channel
UNUSED(size); // ok: fixed format events read from HCI buffer

static const uint8_t ancs_service_uuid[] = {0x79,0x05,0xF4,0x31,0xB5,0xCE,0x4E,0x99,0xA4,0x0F,0x4B,0x1E,0x12,0x2D,0x00,0xD0};
static const uint8_t ancs_notification_source_uuid[] = {0x9F,0xBF,0x12,0x0D,0x63,0x01,0x42,0xD9,0x8C,0x58,0x25,0xE6,0x99,0xA2,0x1D,0xBD};
static const uint8_t ancs_control_point_uuid[] = {0x69,0xD1,0xD8,0xF3,0x45,0xE1,0x49,0xA8,0x98,0x21,0x9B,0xBD,0xFD,0xAA,0xD9,0xD9};
static const uint8_t ancs_data_source_uuid[] = {0x22,0xEA,0xC6,0xE9,0x24,0xD6,0x4B,0xB5,0xBE,0x44,0xB3,0x6A,0xCE,0x7C,0x7B,0xFB};


int connection_encrypted;

// handle connect / disconncet events first
@@ -55,11 +55,11 @@ typedef enum {
ATT_WRITE,
} att_operation_t;

// Buetooth Base UUID 00000000-0000-1000-8000-00805F9B34FB in little endian
static const uint8_t bluetooth_base_uuid[] = { 0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };


static int is_Bluetooth_Base_UUID(uint8_t const *uuid){
// Bluetooth Base UUID 00000000-0000-1000-8000-00805F9B34FB in little endian
static const uint8_t bluetooth_base_uuid[] = { 0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

if (memcmp(&uuid[0], &bluetooth_base_uuid[0], 12) != 0) return false;
if (memcmp(&uuid[14], &bluetooth_base_uuid[14], 2) != 0) return false;
return true;
@@ -75,26 +75,13 @@ typedef struct {
uint16_t value_handle;
} device_information_field_t;

const uint16_t device_information_characteristic_uuids[] = {
ORG_BLUETOOTH_CHARACTERISTIC_MANUFACTURER_NAME_STRING,
ORG_BLUETOOTH_CHARACTERISTIC_MODEL_NUMBER_STRING,
ORG_BLUETOOTH_CHARACTERISTIC_SERIAL_NUMBER_STRING,
ORG_BLUETOOTH_CHARACTERISTIC_HARDWARE_REVISION_STRING,
ORG_BLUETOOTH_CHARACTERISTIC_FIRMWARE_REVISION_STRING,
ORG_BLUETOOTH_CHARACTERISTIC_SOFTWARE_REVISION_STRING,
ORG_BLUETOOTH_CHARACTERISTIC_SYSTEM_ID,
ORG_BLUETOOTH_CHARACTERISTIC_IEEE_11073_20601_REGULATORY_CERTIFICATION_DATA_LIST,
ORG_BLUETOOTH_CHARACTERISTIC_PNP_ID
};

static device_information_field_t device_information_fields[NUM_INFORMATION_FIELDS];

static uint8_t device_information_system_id[8];
static uint8_t device_information_ieee_regulatory_certification[4];
static uint8_t device_information_pnp_id[7];

static att_service_handler_t device_information_service;

static void set_string(device_information_field_id_t field_id, const char * text){
device_information_fields[field_id].data = (uint8_t*) text;
device_information_fields[field_id].len = strlen(text);
@@ -113,7 +100,20 @@ static uint16_t device_information_service_read_callback(hci_con_handle_t con_ha

void device_information_service_server_init(void){

// get service handle range
const uint16_t device_information_characteristic_uuids[] = {
ORG_BLUETOOTH_CHARACTERISTIC_MANUFACTURER_NAME_STRING,
ORG_BLUETOOTH_CHARACTERISTIC_MODEL_NUMBER_STRING,
ORG_BLUETOOTH_CHARACTERISTIC_SERIAL_NUMBER_STRING,
ORG_BLUETOOTH_CHARACTERISTIC_HARDWARE_REVISION_STRING,
ORG_BLUETOOTH_CHARACTERISTIC_FIRMWARE_REVISION_STRING,
ORG_BLUETOOTH_CHARACTERISTIC_SOFTWARE_REVISION_STRING,
ORG_BLUETOOTH_CHARACTERISTIC_SYSTEM_ID,
ORG_BLUETOOTH_CHARACTERISTIC_IEEE_11073_20601_REGULATORY_CERTIFICATION_DATA_LIST,
ORG_BLUETOOTH_CHARACTERISTIC_PNP_ID
};


// get service handle range
uint16_t start_handle;
uint16_t end_handle;
int service_found = gatt_server_get_get_handle_range_for_service_with_uuid16(ORG_BLUETOOTH_SERVICE_DEVICE_INFORMATION, &start_handle, &end_handle);
@@ -59,10 +59,6 @@
#include "ble/gatt-service/nordic_spp_service_server.h"

//
static const uint8_t nordic_spp_profile_uuid128[] = { 0x6E, 0x40, 0x00, 0x01, 0xB5, 0xA3, 0xF3, 0x93, 0xE0, 0xA9, 0xE5, 0x0E, 0x24, 0xDC, 0xCA, 0x9E };
static const uint8_t nordic_spp_rx_uuid128[] = { 0x6E, 0x40, 0x00, 0x02, 0xB5, 0xA3, 0xF3, 0x93, 0xE0, 0xA9, 0xE5, 0x0E, 0x24, 0xDC, 0xCA, 0x9E };
static const uint8_t nordic_spp_tx_uuid128[] = { 0x6E, 0x40, 0x00, 0x03, 0xB5, 0xA3, 0xF3, 0x93, 0xE0, 0xA9, 0xE5, 0x0E, 0x24, 0xDC, 0xCA, 0x9E };

static att_service_handler_t nordic_spp_service;
static void (*client_callback)(hci_con_handle_t con_handle, const uint8_t * data, uint16_t size);

@@ -108,7 +104,12 @@ static int nordic_spp_service_write_callback(hci_con_handle_t con_handle, uint16
* @param callback for tx data from peer
*/
void nordic_spp_service_server_init(void (*callback)(hci_con_handle_t con_handle, const uint8_t * data, uint16_t size)){
client_callback = callback;

static const uint8_t nordic_spp_profile_uuid128[] = { 0x6E, 0x40, 0x00, 0x01, 0xB5, 0xA3, 0xF3, 0x93, 0xE0, 0xA9, 0xE5, 0x0E, 0x24, 0xDC, 0xCA, 0x9E };
static const uint8_t nordic_spp_rx_uuid128[] = { 0x6E, 0x40, 0x00, 0x02, 0xB5, 0xA3, 0xF3, 0x93, 0xE0, 0xA9, 0xE5, 0x0E, 0x24, 0xDC, 0xCA, 0x9E };
static const uint8_t nordic_spp_tx_uuid128[] = { 0x6E, 0x40, 0x00, 0x03, 0xB5, 0xA3, 0xF3, 0x93, 0xE0, 0xA9, 0xE5, 0x0E, 0x24, 0xDC, 0xCA, 0x9E };

client_callback = callback;

// get service handle range
uint16_t start_handle = 0;
@@ -58,9 +58,6 @@
#define UBLOX_SPP_CREDITS_THRESHOLD 8

//
static const uint8_t ublox_spp_profile_uuid128[] = { 0x24, 0x56, 0xE1, 0xB9, 0x26, 0xE2, 0x8F, 0x83, 0xE7, 0x44, 0xF3, 0x4F, 0x01, 0xE9, 0xD7, 0x01 };
static const uint8_t ublox_spp_fifo_uuid128[] = { 0x24, 0x56, 0xE1, 0xB9, 0x26, 0xE2, 0x8F, 0x83, 0xE7, 0x44, 0xF3, 0x4F, 0x01, 0xE9, 0xD7, 0x03 };
static const uint8_t ublox_spp_credits_uuid128[] = { 0x24, 0x56, 0xE1, 0xB9, 0x26, 0xE2, 0x8F, 0x83, 0xE7, 0x44, 0xF3, 0x4F, 0x01, 0xE9, 0xD7, 0x04 };

typedef struct {
hci_con_handle_t con_handle;
@@ -206,6 +203,11 @@ static void ublox_spp_credits_callback(void * context){
*/
void ublox_spp_service_server_init(void (*client_data_callback)(hci_con_handle_t con_handle, const uint8_t * data, uint16_t size),
void (*client_credits_callback)(hci_con_handle_t con_handle, uint16_t credits)){

static const uint8_t ublox_spp_profile_uuid128[] = { 0x24, 0x56, 0xE1, 0xB9, 0x26, 0xE2, 0x8F, 0x83, 0xE7, 0x44, 0xF3, 0x4F, 0x01, 0xE9, 0xD7, 0x01 };
static const uint8_t ublox_spp_fifo_uuid128[] = { 0x24, 0x56, 0xE1, 0xB9, 0x26, 0xE2, 0x8F, 0x83, 0xE7, 0x44, 0xF3, 0x4F, 0x01, 0xE9, 0xD7, 0x03 };
static const uint8_t ublox_spp_credits_uuid128[] = { 0x24, 0x56, 0xE1, 0xB9, 0x26, 0xE2, 0x8F, 0x83, 0xE7, 0x44, 0xF3, 0x4F, 0x01, 0xE9, 0xD7, 0x04 };

ublox_spp_service_t * instance = &ublox_spp;
instance->client_data_callback = client_data_callback;
instance->client_credits_callback = client_credits_callback;
@@ -100,11 +100,12 @@ static uint32_t num_valid_entries;
static const btstack_tlv_t * le_device_db_tlv_btstack_tlv_impl;
static void * le_device_db_tlv_btstack_tlv_context;

static const char tag_0 = 'B';
static const char tag_1 = 'T';
static const char tag_2 = 'D';

static uint32_t le_device_db_tlv_tag_for_index(uint8_t index){
static const char tag_0 = 'B';
static const char tag_1 = 'T';
static const char tag_2 = 'D';

return (tag_0 << 24) | (tag_1 << 16) | (tag_2 << 8) | index;
}

@@ -376,27 +376,6 @@ static uint16_t sm_active_connection_handle = HCI_CON_HANDLE_INVALID;
static int (*sm_get_oob_data)(uint8_t addres_type, bd_addr_t addr, uint8_t * oob_data) = NULL;
static int (*sm_get_sc_oob_data)(uint8_t addres_type, bd_addr_t addr, uint8_t * oob_sc_peer_confirm, uint8_t * oob_sc_peer_random);

// horizontal: initiator capabilities
// vertial: responder capabilities
static const stk_generation_method_t stk_generation_method [5] [5] = {
{ JUST_WORKS, JUST_WORKS, PK_INIT_INPUT, JUST_WORKS, PK_INIT_INPUT },
{ JUST_WORKS, JUST_WORKS, PK_INIT_INPUT, JUST_WORKS, PK_INIT_INPUT },
{ PK_RESP_INPUT, PK_RESP_INPUT, PK_BOTH_INPUT, JUST_WORKS, PK_RESP_INPUT },
{ JUST_WORKS, JUST_WORKS, JUST_WORKS, JUST_WORKS, JUST_WORKS },
{ PK_RESP_INPUT, PK_RESP_INPUT, PK_INIT_INPUT, JUST_WORKS, PK_RESP_INPUT },
};

// uses numeric comparison if one side has DisplayYesNo and KeyboardDisplay combinations
#ifdef ENABLE_LE_SECURE_CONNECTIONS
static const stk_generation_method_t stk_generation_method_with_secure_connection[5][5] = {
{ JUST_WORKS, JUST_WORKS, PK_INIT_INPUT, JUST_WORKS, PK_INIT_INPUT },
{ JUST_WORKS, NUMERIC_COMPARISON, PK_INIT_INPUT, JUST_WORKS, NUMERIC_COMPARISON },
{ PK_RESP_INPUT, PK_RESP_INPUT, PK_BOTH_INPUT, JUST_WORKS, PK_RESP_INPUT },
{ JUST_WORKS, JUST_WORKS, JUST_WORKS, JUST_WORKS, JUST_WORKS },
{ PK_RESP_INPUT, NUMERIC_COMPARISON, PK_INIT_INPUT, JUST_WORKS, NUMERIC_COMPARISON },
};
#endif

static void sm_run(void);
static void sm_done_for_handle(hci_con_handle_t con_handle);
static sm_connection_t * sm_get_connection_for_handle(hci_con_handle_t con_handle);
@@ -750,6 +729,27 @@ static void sm_notify_client_status_reason(sm_connection_t * sm_conn, uint8_t st
// - OOB data availability
static void sm_setup_tk(void){

// horizontal: initiator capabilities
// vertial: responder capabilities
static const stk_generation_method_t stk_generation_method [5] [5] = {
{ JUST_WORKS, JUST_WORKS, PK_INIT_INPUT, JUST_WORKS, PK_INIT_INPUT },
{ JUST_WORKS, JUST_WORKS, PK_INIT_INPUT, JUST_WORKS, PK_INIT_INPUT },
{ PK_RESP_INPUT, PK_RESP_INPUT, PK_BOTH_INPUT, JUST_WORKS, PK_RESP_INPUT },
{ JUST_WORKS, JUST_WORKS, JUST_WORKS, JUST_WORKS, JUST_WORKS },
{ PK_RESP_INPUT, PK_RESP_INPUT, PK_INIT_INPUT, JUST_WORKS, PK_RESP_INPUT },
};

// uses numeric comparison if one side has DisplayYesNo and KeyboardDisplay combinations
#ifdef ENABLE_LE_SECURE_CONNECTIONS
static const stk_generation_method_t stk_generation_method_with_secure_connection[5][5] = {
{ JUST_WORKS, JUST_WORKS, PK_INIT_INPUT, JUST_WORKS, PK_INIT_INPUT },
{ JUST_WORKS, NUMERIC_COMPARISON, PK_INIT_INPUT, JUST_WORKS, NUMERIC_COMPARISON },
{ PK_RESP_INPUT, PK_RESP_INPUT, PK_BOTH_INPUT, JUST_WORKS, PK_RESP_INPUT },
{ JUST_WORKS, JUST_WORKS, JUST_WORKS, JUST_WORKS, JUST_WORKS },
{ PK_RESP_INPUT, NUMERIC_COMPARISON, PK_INIT_INPUT, JUST_WORKS, NUMERIC_COMPARISON },
};
#endif

// default: just works
setup->sm_stk_generation_method = JUST_WORKS;

@@ -1530,11 +1530,13 @@ static void f4_engine(sm_connection_t * sm_conn, const sm_key256_t u, const sm_k
sm_cmac_message_start(x, message_len, sm_cmac_sc_buffer, &sm_sc_cmac_done);
}

static const sm_key_t f5_salt = { 0x6C ,0x88, 0x83, 0x91, 0xAA, 0xF5, 0xA5, 0x38, 0x60, 0x37, 0x0B, 0xDB, 0x5A, 0x60, 0x83, 0xBE};
static const uint8_t f5_key_id[] = { 0x62, 0x74, 0x6c, 0x65 };
static const uint8_t f5_length[] = { 0x01, 0x00};

static void f5_calculate_salt(sm_connection_t * sm_conn){

static const sm_key_t f5_salt = { 0x6C ,0x88, 0x83, 0x91, 0xAA, 0xF5, 0xA5, 0x38, 0x60, 0x37, 0x0B, 0xDB, 0x5A, 0x60, 0x83, 0xBE};

log_info("f5_calculate_salt");
// calculate salt for f5
const uint16_t message_len = 32;
@@ -3439,27 +3441,27 @@ static int sm_validate_stk_generation_method(void){
}
}

// size of complete sm_pdu used to validate input
static const uint8_t sm_pdu_size[] = {
0, // 0x00 invalid opcode
7, // 0x01 pairing request
7, // 0x02 pairing response
17, // 0x03 pairing confirm
17, // 0x04 pairing random
2, // 0x05 pairing failed
17, // 0x06 encryption information
11, // 0x07 master identification
17, // 0x08 identification information
8, // 0x09 identify address information
17, // 0x0a signing information
2, // 0x0b security request
65, // 0x0c pairing public key
17, // 0x0d pairing dhk check
2, // 0x0e keypress notification
};

static void sm_pdu_handler(uint8_t packet_type, hci_con_handle_t con_handle, uint8_t *packet, uint16_t size){

// size of complete sm_pdu used to validate input
static const uint8_t sm_pdu_size[] = {
0, // 0x00 invalid opcode
7, // 0x01 pairing request
7, // 0x02 pairing response
17, // 0x03 pairing confirm
17, // 0x04 pairing random
2, // 0x05 pairing failed
17, // 0x06 encryption information
11, // 0x07 master identification
17, // 0x08 identification information
8, // 0x09 identify address information
17, // 0x0a signing information
2, // 0x0b security request
65, // 0x0c pairing public key
17, // 0x0d pairing dhk check
2, // 0x0e keypress notification
};

if ((packet_type == HCI_EVENT_PACKET) && (packet[0] == L2CAP_EVENT_CAN_SEND_NOW)){
sm_run();
}
@@ -4290,6 +4292,9 @@ static void sm_handle_random_result_oob(void * arg){
sm_run();
}
uint8_t sm_generate_sc_oob_data(void (*callback)(const uint8_t * confirm_value, const uint8_t * random_value)){

static btstack_crypto_random_t sm_crypto_random_oob_request;

if (sm_sc_oob_state != SM_SC_OOB_IDLE) return ERROR_CODE_COMMAND_DISALLOWED;
sm_sc_oob_callback = callback;
sm_sc_oob_state = SM_SC_OOB_W4_RANDOM;
@@ -45,26 +45,6 @@
#include <string.h>
#include <stdio.h>

// map ascii char to 6-bit value
static const uint8_t table[256] = {
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 62, 99, 99, 99, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 99, 99, 99, 99, 99, 99,
99, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 99, 99, 99, 99, 99,
99, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99
};

/**
* @brief Initialize base99 decoder
* @param context
@@ -80,6 +60,26 @@ void btstack_base64_decoder_init(btstack_base64_decoder_t * context){
*/
int btstack_base64_decoder_process_byte(btstack_base64_decoder_t * context, uint8_t c){

// map ascii char to 6-bit value
static const uint8_t table[256] = {
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 62, 99, 99, 99, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 99, 99, 99, 99, 99, 99,
99, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 99, 99, 99, 99, 99,
99, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99
};

// handle '='
if (c == '='){
if ((context->pos == 2) || (context->pos == 3)){
@@ -54,8 +54,6 @@
* btstack_hid_parser.c
*/

const int hid_item_sizes[] = { 0, 1, 2, 4 };

#ifdef HID_PARSER_PRETTY_PRINT

static const char * type_names[] = {
@@ -150,6 +148,9 @@ static void hid_pretty_print_item(btstack_hid_parser_t * parser, hid_descriptor_

// parse descriptor item and read up to 32-bit bit value
void btstack_hid_parse_descriptor_item(hid_descriptor_item_t * item, const uint8_t * hid_descriptor, uint16_t hid_descriptor_len){

const int hid_item_sizes[] = { 0, 1, 2, 4 };

// parse item header
if (hid_descriptor_len < 1) return;
uint16_t pos = 0;

0 comments on commit 8334d3d

Please sign in to comment.
You can’t perform that action at this time.