core: added type_id to the channel struct;
This commit is contained in:
		
							parent
							
								
									1cb8d3ad15
								
							
						
					
					
						commit
						ab242783d8
					
				| @ -127,6 +127,7 @@ typedef struct __sxchannel_t { | |||||||
|   sxlink_t *link; /** < pointer to the underlying link */ |   sxlink_t *link; /** < pointer to the underlying link */ | ||||||
|   struct __link_rpc_list_type *rpc_list; /** < rpc functions list */ |   struct __link_rpc_list_type *rpc_list; /** < rpc functions list */ | ||||||
|   int flags; /** < flags of the channel */ |   int flags; /** < flags of the channel */ | ||||||
|  |   int type_id; /** < channel type id */ | ||||||
| } sxchnl_t; | } sxchnl_t; | ||||||
| 
 | 
 | ||||||
| /* message flags */ | /* message flags */ | ||||||
|  | |||||||
| @ -79,6 +79,7 @@ uint8_t _channel_open(sxlink_t *co, uint16_t *chid) | |||||||
|   chan->link = co; |   chan->link = co; | ||||||
|   chan->rpc_list = rpclist; |   chan->rpc_list = rpclist; | ||||||
|   chan->flags = 0; |   chan->flags = 0; | ||||||
|  |   chan->type_id = typeid; | ||||||
| 
 | 
 | ||||||
|   pthread_mutex_lock(&co->idx_ch_lock); |   pthread_mutex_lock(&co->idx_ch_lock); | ||||||
|   chidx = idx_allocate(&co->idx_ch); |   chidx = idx_allocate(&co->idx_ch); | ||||||
| @ -172,6 +173,7 @@ sxchnl_t *sxchannel_open(sxlink_t *co, int type) | |||||||
| 
 | 
 | ||||||
|   /* ok all is fine */ |   /* ok all is fine */ | ||||||
|   chan->cid = msg->mhead.reserve; |   chan->cid = msg->mhead.reserve; | ||||||
|  |   chan->type_id = type; | ||||||
|   ccid = chan->cid; |   ccid = chan->cid; | ||||||
|   pthread_mutex_lock(&co->idx_ch_lock); |   pthread_mutex_lock(&co->idx_ch_lock); | ||||||
|   idx_reserve(&co->idx_ch, ccid); |   idx_reserve(&co->idx_ch, ccid); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user