Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 111697
Collapse All | Expand All

(-)multisync/plugins/irmc_sync/src/irmc_obex.c (+19 lines)
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; 
(-)multisync/plugins/irmc_sync/src/irmc_obex.h (+1 lines)
Lines 63-68 Link Here
63
  int connected;
63
  int connected;
64
  struct termios oldtio;
64
  struct termios oldtio;
65
  cobex_t cobex; // Data for OBEX over cable
65
  cobex_t cobex; // Data for OBEX over cable
66
  uint32_t connection_id; /* set to 0xffffffff if unused */
66
} obexdata_t;
67
} obexdata_t;
67
68
68
69

Return to bug 111697