diff --git a/example/Makefile.in b/example/Makefile.in index 07c710c7a..6c73496c7 100644 --- a/example/Makefile.in +++ b/example/Makefile.in @@ -30,7 +30,7 @@ rfcomm: rfcomm.c @USE_LDID@ export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate ; ldid -S $@ clean: - rm -f test mitm rfcomm inquiry l2cap-server obex + rm -f test mitm rfcomm inquiry l2cap-server l2cap-throughput obex install: echo "nothing to be done" diff --git a/example/l2cap-server.c b/example/l2cap-server.c index cfe5cb8f4..4f8f4ef39 100644 --- a/example/l2cap-server.c +++ b/example/l2cap-server.c @@ -79,7 +79,7 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint case BTSTACK_EVENT_STATE: // bt stack activated, get started - set local name if (packet[2] == HCI_STATE_WORKING) { - bt_send_cmd(&hci_write_local_name, "BTstack-Test"); + bt_send_cmd(&hci_write_authentication_enable, 0); } break; @@ -162,10 +162,6 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint break; case HCI_EVENT_COMMAND_COMPLETE: - // use pairing yes/no - if ( COMMAND_COMPLETE_EVENT(packet, hci_write_local_name) ) { - bt_send_cmd(&hci_write_authentication_enable, 0); - } if ( COMMAND_COMPLETE_EVENT(packet, hci_write_authentication_enable) ) { bt_send_cmd(&hci_write_class_of_device, 0x2540); } diff --git a/example/l2cap-throughput.c b/example/l2cap-throughput.c index e70f4b513..f434eeb84 100644 --- a/example/l2cap-throughput.c +++ b/example/l2cap-throughput.c @@ -51,6 +51,8 @@ bd_addr_t addr = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; uint8_t packet[PACKET_SIZE]; uint32_t counter = 0; +timer_source_t timer; + void update_packet(){ net_store_32( packet, 0, counter++); } @@ -62,6 +64,11 @@ void prepare_packet(){ for (i=4;i