mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-14 01:27:41 +00:00
Merge branch 'develop'
This commit is contained in:
commit
22fe8451e4
2
3rd-party/mbedtls/library/ecp.c
vendored
2
3rd-party/mbedtls/library/ecp.c
vendored
@ -1456,7 +1456,7 @@ static int ecp_mul_naive( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
|
||||
// calculate m * p using double and add in decreasing fashion to use ecp_add_mixed
|
||||
mbedtls_ecp_point_init(R);
|
||||
for (i=grp->nbits;i >= 0;i--){
|
||||
for (i=(int)grp->nbits;i >= 0;i--){
|
||||
MBEDTLS_MPI_CHK( ecp_double_jac( grp, R, R ) );
|
||||
|
||||
#if MBEDTLS_ECP_MUL_NAIVE_SAFE == 1
|
||||
|
@ -136,7 +136,7 @@ static void btstack_run_loop_posix_disable_data_source_callbacks(btstack_data_so
|
||||
static uint32_t btstack_run_loop_posix_get_time_ms(void){
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
uint32_t time_ms = ((tv.tv_sec - init_tv.tv_sec) * 1000) + (tv.tv_usec / 1000);
|
||||
uint32_t time_ms = (uint32_t)((tv.tv_sec - init_tv.tv_sec) * 1000) + (tv.tv_usec / 1000);
|
||||
log_debug("btstack_run_loop_posix_get_time_ms: %u <- %u / %u", time_ms, (int) tv.tv_sec, (int) tv.tv_usec);
|
||||
return time_ms;
|
||||
}
|
||||
@ -190,7 +190,7 @@ static void btstack_run_loop_posix_execute(void) {
|
||||
delta = 0;
|
||||
}
|
||||
tv.tv_sec = delta / 1000;
|
||||
tv.tv_usec = (delta - (tv.tv_sec * 1000)) * 1000;
|
||||
tv.tv_usec = (int) (delta - (tv.tv_sec * 1000)) * 1000;
|
||||
log_debug("btstack_run_loop_execute next timeout in %u ms", delta);
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ static void btstack_uart_posix_process_write(btstack_data_source_t *ds) {
|
||||
uint32_t start = btstack_run_loop_get_time_ms();
|
||||
|
||||
// write up to write_bytes_len to fd
|
||||
int bytes_written = write(ds->fd, write_bytes_data, write_bytes_len);
|
||||
int bytes_written = (int) write(ds->fd, write_bytes_data, write_bytes_len);
|
||||
if (bytes_written < 0) {
|
||||
btstack_run_loop_enable_data_source_callbacks(ds, DATA_SOURCE_CALLBACK_WRITE);
|
||||
return;
|
||||
|
@ -12,7 +12,8 @@ GLOBAL_INCLUDES += . ../../src ../../platform/embedded ../../chipset/bcm ../../.
|
||||
|
||||
# core BTstack sources
|
||||
$(NAME)_SOURCES += \
|
||||
../../src/ble/att_db.c \
|
||||
../../src/ble/ad_parser.c \
|
||||
../../src/ble/att_db.c \
|
||||
../../src/ble/att_dispatch.c \
|
||||
../../src/ble/att_server.c \
|
||||
../../src/ble/le_device_db_memory.c \
|
||||
@ -20,9 +21,9 @@ $(NAME)_SOURCES += \
|
||||
../../src/classic/hsp_hs.c \
|
||||
../../src/classic/btstack_link_key_db_memory.c \
|
||||
../../src/classic/rfcomm.c \
|
||||
../../src/classic/sdp_server.c \
|
||||
../../src/classic/sdp_server.c \
|
||||
../../src/classic/sdp_client.c \
|
||||
../../src/classic/sdp_client_rfcomm.c \
|
||||
../../src/classic/sdp_client_rfcomm.c \
|
||||
../../src/classic/sdp_util.c \
|
||||
../../src/classic/spp_server.c \
|
||||
../../src/btstack_linked_list.c \
|
||||
@ -31,7 +32,7 @@ $(NAME)_SOURCES += \
|
||||
../../src/btstack_run_loop.c \
|
||||
../../src/btstack_util.c \
|
||||
../../src/hci.c \
|
||||
../../src/hci_cmd.c \
|
||||
../../src/hci_cmd.c \
|
||||
../../src/hci_dump.c \
|
||||
../../src/l2cap.c \
|
||||
../../src/l2cap_signaling.c \
|
||||
@ -44,7 +45,7 @@ $(NAME)_SOURCES += \
|
||||
../../chipset/bcm/btstack_chipset_bcm.c \
|
||||
|
||||
ifeq ($(BT_CHIP_XTAL_FREQUENCY),)
|
||||
$(NAME)_SOURCES := ../../../drivers/bluetooth/firmware/$(BT_CHIP)$(BT_CHIP_REVISION)/bt_firmware_image.c
|
||||
$(NAME)_SOURCES += ../../../drivers/bluetooth/firmware/$(BT_CHIP)$(BT_CHIP_REVISION)/bt_firmware_image.c
|
||||
else
|
||||
$(NAME)_SOURCES := ../../../drivers/bluetooth/firmware/$(BT_CHIP)$(BT_CHIP_REVISION)/$(BT_CHIP_XTAL_FREQUENCY)/bt_firmware_image.c
|
||||
$(NAME)_SOURCES += ../../../drivers/bluetooth/firmware/$(BT_CHIP)$(BT_CHIP_REVISION)/$(BT_CHIP_XTAL_FREQUENCY)/bt_firmware_image.c
|
||||
endif
|
||||
|
@ -106,7 +106,6 @@ static void att_handle_value_indication_notify_client(uint8_t status, uint16_t c
|
||||
little_endian_store_16(event, pos, client_handle);
|
||||
pos += 2;
|
||||
little_endian_store_16(event, pos, attribute_handle);
|
||||
pos += 2;
|
||||
(*att_client_packet_handler)(HCI_EVENT_PACKET, 0, &event[0], sizeof(event));
|
||||
}
|
||||
|
||||
@ -120,7 +119,6 @@ static void att_emit_mtu_event(hci_con_handle_t con_handle, uint16_t mtu){
|
||||
little_endian_store_16(event, pos, con_handle);
|
||||
pos += 2;
|
||||
little_endian_store_16(event, pos, mtu);
|
||||
pos += 2;
|
||||
(*att_client_packet_handler)(HCI_EVENT_PACKET, 0, &event[0], sizeof(event));
|
||||
}
|
||||
|
||||
|
@ -785,7 +785,7 @@ static void bnep_channel_finalize(bnep_channel_t *channel)
|
||||
static int bnep_handle_connection_request(bnep_channel_t *channel, uint8_t *packet, uint16_t size)
|
||||
{
|
||||
uint16_t uuid_size;
|
||||
uint16_t uuid_offset;
|
||||
uint16_t uuid_offset = 0; // avoid "may be unitialized when used" in clang
|
||||
uuid_size = packet[1];
|
||||
uint16_t response_code = BNEP_RESP_SETUP_SUCCESS;
|
||||
bnep_service_t * service;
|
||||
|
@ -207,7 +207,7 @@ void hfp_emit_string_event(btstack_packet_handler_t callback, uint8_t event_subt
|
||||
event[0] = HCI_EVENT_HFP_META;
|
||||
event[1] = sizeof(event) - 2;
|
||||
event[2] = event_subtype;
|
||||
int size = (strlen(value) < sizeof(event) - 4) ? strlen(value) : sizeof(event) - 4;
|
||||
int size = (strlen(value) < sizeof(event) - 4) ? (int) strlen(value) : sizeof(event) - 4;
|
||||
strncpy((char*)&event[3], value, size);
|
||||
event[3 + size] = 0;
|
||||
(*callback)(HCI_EVENT_PACKET, 0, event, sizeof(event));
|
||||
|
@ -272,7 +272,7 @@ static int string_len_for_uint32(uint32_t i){
|
||||
// get size for indicator string
|
||||
static int hfp_ag_indicators_string_size(hfp_connection_t * hfp_connection, int i){
|
||||
// template: ("$NAME",($MIN,$MAX))
|
||||
return 8 + strlen(hfp_ag_get_ag_indicators(hfp_connection)[i].name)
|
||||
return 8 + (int) strlen(hfp_ag_get_ag_indicators(hfp_connection)[i].name)
|
||||
+ string_len_for_uint32(hfp_ag_get_ag_indicators(hfp_connection)[i].min_range)
|
||||
+ string_len_for_uint32(hfp_ag_get_ag_indicators(hfp_connection)[i].min_range);
|
||||
}
|
||||
@ -1034,6 +1034,7 @@ static void hfp_ag_set_callsetup_indicator(void){
|
||||
hfp_ag_indicator_t * indicator = get_ag_indicator_for_name("callsetup");
|
||||
if (!indicator){
|
||||
log_error("hfp_ag_set_callsetup_indicator: callsetup indicator is missing");
|
||||
return;
|
||||
};
|
||||
indicator->status = hfp_gsm_callsetup_status();
|
||||
}
|
||||
@ -1042,6 +1043,7 @@ static void hfp_ag_set_callheld_indicator(void){
|
||||
hfp_ag_indicator_t * indicator = get_ag_indicator_for_name("callheld");
|
||||
if (!indicator){
|
||||
log_error("hfp_ag_set_callheld_state: callheld indicator is missing");
|
||||
return;
|
||||
};
|
||||
indicator->status = hfp_gsm_callheld_status();
|
||||
}
|
||||
@ -1050,6 +1052,7 @@ static void hfp_ag_set_call_indicator(void){
|
||||
hfp_ag_indicator_t * indicator = get_ag_indicator_for_name("call");
|
||||
if (!indicator){
|
||||
log_error("hfp_ag_set_call_state: call indicator is missing");
|
||||
return;
|
||||
};
|
||||
indicator->status = hfp_gsm_call_status();
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ static void hfp_gsm_set_clip(int index_in_table, uint8_t type, const char * numb
|
||||
|
||||
gsm_calls[index_in_table].clip_type = type;
|
||||
|
||||
int clip_number_size = strlen(number) < HFP_GSM_MAX_CALL_NUMBER_SIZE ? strlen(number) : HFP_GSM_MAX_CALL_NUMBER_SIZE-1;
|
||||
int clip_number_size = strlen(number) < HFP_GSM_MAX_CALL_NUMBER_SIZE ? (int) strlen(number) : HFP_GSM_MAX_CALL_NUMBER_SIZE-1;
|
||||
strncpy(gsm_calls[index_in_table].clip_number, number, clip_number_size);
|
||||
gsm_calls[index_in_table].clip_number[clip_number_size] = '\0';
|
||||
strncpy(last_dialed_number, number, clip_number_size);
|
||||
|
@ -102,7 +102,7 @@ static void hfp_hf_emit_subscriber_information(btstack_packet_handler_t callback
|
||||
event[2] = event_subtype;
|
||||
event[3] = status;
|
||||
event[4] = bnip_type;
|
||||
int size = (strlen(bnip_number) < sizeof(event) - 6) ? strlen(bnip_number) : sizeof(event) - 6;
|
||||
int size = (strlen(bnip_number) < sizeof(event) - 6) ? (int) strlen(bnip_number) : sizeof(event) - 6;
|
||||
strncpy((char*)&event[5], bnip_number, size);
|
||||
event[5 + size] = 0;
|
||||
(*callback)(HCI_EVENT_PACKET, 0, event, sizeof(event));
|
||||
@ -115,7 +115,7 @@ static void hfp_hf_emit_type_and_number(btstack_packet_handler_t callback, uint8
|
||||
event[1] = sizeof(event) - 2;
|
||||
event[2] = event_subtype;
|
||||
event[3] = bnip_type;
|
||||
int size = (strlen(bnip_number) < sizeof(event) - 5) ? strlen(bnip_number) : sizeof(event) - 5;
|
||||
int size = (strlen(bnip_number) < sizeof(event) - 5) ? (int) strlen(bnip_number) : sizeof(event) - 5;
|
||||
strncpy((char*)&event[4], bnip_number, size);
|
||||
event[4 + size] = 0;
|
||||
(*callback)(HCI_EVENT_PACKET, 0, event, sizeof(event));
|
||||
@ -133,7 +133,7 @@ static void hfp_hf_emit_enhanced_call_status(btstack_packet_handler_t callback,
|
||||
event[6] = clcc_status;
|
||||
event[7] = clcc_mpty;
|
||||
event[8] = bnip_type;
|
||||
int size = (strlen(bnip_number) < sizeof(event) - 10) ? strlen(bnip_number) : sizeof(event) - 10;
|
||||
int size = (strlen(bnip_number) < sizeof(event) - 10) ? (int) strlen(bnip_number) : sizeof(event) - 10;
|
||||
strncpy((char*)&event[9], bnip_number, size);
|
||||
event[9 + size] = 0;
|
||||
(*callback)(HCI_EVENT_PACKET, 0, event, sizeof(event));
|
||||
|
@ -3113,7 +3113,6 @@ static void hci_emit_dedicated_bonding_result(bd_addr_t address, uint8_t status)
|
||||
event[pos++] = sizeof(event) - 2;
|
||||
event[pos++] = status;
|
||||
reverse_bd_addr(address, &event[pos]);
|
||||
pos += 6;
|
||||
hci_emit_event(event, sizeof(event), 1);
|
||||
}
|
||||
|
||||
|
@ -192,8 +192,8 @@ void hci_dump_packet(uint8_t packet_type, uint8_t in, uint8_t *packet, uint16_t
|
||||
little_endian_store_16( header_bluez, 0, 1 + len);
|
||||
header_bluez[2] = in;
|
||||
header_bluez[3] = 0;
|
||||
little_endian_store_32( header_bluez, 4, curr_time.tv_sec);
|
||||
little_endian_store_32( header_bluez, 8, curr_time.tv_usec);
|
||||
little_endian_store_32( header_bluez, 4, (uint32_t) curr_time.tv_sec);
|
||||
little_endian_store_32( header_bluez, 8, curr_time.tv_usec);
|
||||
header_bluez[12] = packet_type;
|
||||
write (dump_file, header_bluez, HCIDUMP_HDR_SIZE);
|
||||
write (dump_file, packet, len );
|
||||
@ -201,7 +201,7 @@ void hci_dump_packet(uint8_t packet_type, uint8_t in, uint8_t *packet, uint16_t
|
||||
|
||||
case HCI_DUMP_PACKETLOGGER:
|
||||
big_endian_store_32( header_packetlogger, 0, PKTLOG_HDR_SIZE - 4 + len);
|
||||
big_endian_store_32( header_packetlogger, 4, curr_time.tv_sec);
|
||||
big_endian_store_32( header_packetlogger, 4, (uint32_t) curr_time.tv_sec);
|
||||
big_endian_store_32( header_packetlogger, 8, curr_time.tv_usec);
|
||||
switch (packet_type){
|
||||
case HCI_COMMAND_DATA_PACKET:
|
||||
|
Loading…
x
Reference in New Issue
Block a user