captaingz2github / btstack

Automatically exported from code.google.com/p/btstack
0 stars 0 forks source link

Patch for /trunk/src/rfcomm.c #443

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In a File,rfcomm.c, 
I didn't see the definition of 
bt_store_16 (uint8_t*,uint8_t,uint16_t) either in header files or in the source 
files.
Without knowing the functionality, it's hard to send the patch (It requires 
implementation of bt_store_16(uint8_t*,uint8_t,uint16_t) either as Macro or API)

Original issue reported on code.google.com by svrajas...@gmail.com on 12 Feb 2015 at 8:51

Attachments:

GoogleCodeExporter commented 9 years ago
bt_store_16 is defined in include/btstack/util.h and implemented in src/utils.c

Please tell me what you want to do with BTstack and what's the goal of these 
patches at matthias.ringwald@gmail.com - I'm a bit confused :) 

Original comment by matthias.ringwald@gmail.com on 12 Feb 2015 at 9:50

GoogleCodeExporter commented 9 years ago
Now, Status looks likes a Bug, I gone through the Implementation of code in 
src/utils.c
void bt_store_16(uint8_t *buffer, uint16_t pos, uint16_t value){
    buffer[pos++] = value;
    buffer[pos++] = value >> 8;
}
As per my understanding,The below mentioned API's will give the compilation 
error from the file trunk/src/rfcomm.c

static void rfcomm_emit_channel_opened(rfcomm_channel_t *channel, uint8_t 
status);
static void rfcomm_emit_channel_open_failed_outgoing_memory(void * connection, 
bd_addr_t *addr, uint8_t server_channel);

Above mentioned API's yields the error due to the uint8_t variable inside the 
API definition.

here there are two possibilities, one possibility is to modify the variable 
with in the API (we should comprise for the optimization),and other is to 
modify the function definition of (bt_store_16) in src/util.c to support the 
below mentioned signature of bt_store_16 (uint8_t*,uint8_t,uint16_t).

Can you please confirm the same.

I modify the API's, to support the API definition in src/util.c using the 
Compiler Flag #BTSTACK_LE

Original comment by svrajas...@gmail.com on 13 Feb 2015 at 5:15