remove alignment hack for sdp service record buffer

This commit is contained in:
Matthias Ringwald 2015-11-15 21:03:03 +01:00
parent 9293bfa465
commit 22c004edd1
3 changed files with 15 additions and 15 deletions

View File

@ -79,7 +79,7 @@
#define HEARTBEAT_PERIOD_MS 1000
static uint16_t rfcomm_channel_id;
static uint32_t spp_service_buffer[150/4]; // implicit alignment to 4-byte memory address
static uint8_t spp_service_buffer[150];
static int le_notification_enabled;
// THE Couner
@ -261,9 +261,9 @@ int btstack_main(void)
// init SDP, create record for SPP and register with SDP
sdp_init();
memset(spp_service_buffer, 0, sizeof(spp_service_buffer));
sdp_create_spp_service( (uint8_t*)spp_service_buffer, RFCOMM_SERVER_CHANNEL, "SPP Counter");
printf("SDP service record size: %u\n", de_get_len((uint8_t*)spp_service_buffer));
sdp_register_service((uint8_t*)spp_service_buffer);
sdp_create_spp_service(spp_service_buffer, RFCOMM_SERVER_CHANNEL, "SPP Counter");
sdp_register_service(spp_service_buffer);
printf("SDP service record size: %u\n", de_get_len(spp_service_buffer));
hci_ssp_set_io_capability(SSP_IO_CAPABILITY_DISPLAY_YES_NO);

View File

@ -70,8 +70,8 @@
static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size);
static uint16_t rfcomm_channel_id;
static uint32_t spp_service_buffer[150/4]; // implicit alignment to 4-byte memory address
static uint16_t rfcomm_channel_id;
static uint8_t spp_service_buffer[150];
/* @section SPP Service Setup
@ -100,9 +100,9 @@ static void spp_service_setup(void){
// init SDP, create record for SPP and register with SDP
sdp_init();
memset(spp_service_buffer, 0, sizeof(spp_service_buffer));
sdp_create_spp_service( (uint8_t*) spp_service_buffer, RFCOMM_SERVER_CHANNEL, "SPP Counter");
printf("SDP service record size: %u\n", de_get_len((uint8_t*) spp_service_buffer));
sdp_register_service((uint8_t*)spp_service_buffer);
sdp_create_spp_service(spp_service_buffer, RFCOMM_SERVER_CHANNEL, "SPP Counter");
sdp_register_service(spp_service_buffer);
printf("SDP service record size: %u\n", de_get_len(spp_service_buffer));
}
/* LISTING_END */

View File

@ -64,10 +64,10 @@
static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size);
static uint8_t rfcomm_channel_nr = 1;
static uint16_t rfcomm_channel_id;
static uint8_t rfcomm_send_credit = 0;
static uint32_t spp_service_buffer[150/4]; // implicit alignment to 4-byte memory address
static uint8_t rfcomm_channel_nr = 1;
static uint16_t rfcomm_channel_id;
static uint8_t rfcomm_send_credit = 0;
static uint8_t spp_service_buffer[150];
/* @section SPP Service Setup
*
@ -93,9 +93,9 @@ static void spp_service_setup(void){
// init SDP, create record for SPP and register with SDP
sdp_init();
memset(spp_service_buffer, 0, sizeof(spp_service_buffer));
sdp_create_spp_service( (uint8_t*) &spp_service_buffer, 1, "SPP Counter");
printf("SDP service buffer size: %u\n\r", (uint16_t) de_get_len((uint8_t*) sdp_create_spp_service));
sdp_create_spp_service(spp_service_buffer, 1, "SPP Counter");
sdp_register_service(spp_service_buffer);
printf("SDP service buffer size: %u\n\r", (uint16_t) de_get_len(spp_service_buffer));
}
/* LISTING_END */