Lines 117-122
Link Here
|
117 |
void client_done(obex_t *handle, obex_object_t *object, |
117 |
void client_done(obex_t *handle, obex_object_t *object, |
118 |
gint obex_cmd, gint obex_rsp) |
118 |
gint obex_cmd, gint obex_rsp) |
119 |
{ |
119 |
{ |
|
|
120 |
obex_headerdata_t hv; |
121 |
uint8_t hi; |
122 |
uint32_t hlen; |
120 |
obexdata_t *ud; |
123 |
obexdata_t *ud; |
121 |
ud = OBEX_GetUserData(handle); |
124 |
ud = OBEX_GetUserData(handle); |
122 |
|
125 |
|
Lines 124-129
Link Here
|
124 |
|
127 |
|
125 |
switch(obex_cmd) { |
128 |
switch(obex_cmd) { |
126 |
case OBEX_CMD_CONNECT: |
129 |
case OBEX_CMD_CONNECT: |
|
|
130 |
/* save the connection id */ |
131 |
ud->connection_id = 0xffffffff; |
132 |
while(OBEX_ObjectGetNextHeader(handle, object, &hi, &hv, &hlen)) { |
133 |
if(hi == OBEX_HDR_CONNECTION) { |
134 |
fprintf(stderr, "%s() Found connection number: %d\n", __func__, hv.bq4); |
135 |
ud->connection_id = hv.bq4; |
136 |
} |
137 |
} |
127 |
break; |
138 |
break; |
128 |
case OBEX_CMD_DISCONNECT: |
139 |
case OBEX_CMD_DISCONNECT: |
129 |
break; |
140 |
break; |
Lines 692-697
Link Here
|
692 |
|
703 |
|
693 |
userdata = (obexdata_t*) OBEX_GetUserData(handle); |
704 |
userdata = (obexdata_t*) OBEX_GetUserData(handle); |
694 |
if ((object = OBEX_ObjectNew(handle, OBEX_CMD_PUT))) { |
705 |
if ((object = OBEX_ObjectNew(handle, OBEX_CMD_PUT))) { |
|
|
706 |
if(userdata->connection_id != 0xffffffff) |
707 |
(void) OBEX_ObjectAddHeader(handle, object, OBEX_HDR_CONNECTION, |
708 |
(obex_headerdata_t) userdata->connection_id, |
709 |
sizeof(uint32_t), OBEX_FL_FIT_ONE_PACKET); |
695 |
hd.bq4 = body_size; |
710 |
hd.bq4 = body_size; |
696 |
OBEX_ObjectAddHeader(handle, object, OBEX_HDR_LENGTH, hd, 4, 0); |
711 |
OBEX_ObjectAddHeader(handle, object, OBEX_HDR_LENGTH, hd, 4, 0); |
697 |
/* Add unicode name header*/ |
712 |
/* Add unicode name header*/ |
Lines 736-741
Link Here
|
736 |
|
751 |
|
737 |
userdata = (obexdata_t*) OBEX_GetUserData(handle); |
752 |
userdata = (obexdata_t*) OBEX_GetUserData(handle); |
738 |
if((object = OBEX_ObjectNew(handle, OBEX_CMD_GET))) { |
753 |
if((object = OBEX_ObjectNew(handle, OBEX_CMD_GET))) { |
|
|
754 |
if(userdata->connection_id != 0xffffffff) |
755 |
(void) OBEX_ObjectAddHeader(handle, object, OBEX_HDR_CONNECTION, |
756 |
(obex_headerdata_t) userdata->connection_id, |
757 |
sizeof(uint32_t), OBEX_FL_FIT_ONE_PACKET); |
739 |
/* Add unicode name header*/ |
758 |
/* Add unicode name header*/ |
740 |
namesize = OBEX_CharToUnicode(unicodename, name, 1024); |
759 |
namesize = OBEX_CharToUnicode(unicodename, name, 1024); |
741 |
hd.bs = unicodename; |
760 |
hd.bs = unicodename; |