diff --git a/include/sxmp/sxmp.h b/include/sxmp/sxmp.h index 948908e..44a2324 100644 --- a/include/sxmp/sxmp.h +++ b/include/sxmp/sxmp.h @@ -127,6 +127,7 @@ typedef struct __sxchannel_t { sxlink_t *link; /** < pointer to the underlying link */ struct __link_rpc_list_type *rpc_list; /** < rpc functions list */ int flags; /** < flags of the channel */ + int type_id; /** < channel type id */ } sxchnl_t; /* message flags */ diff --git a/lib/channel.c b/lib/channel.c index 2c3e8f6..a6267e3 100644 --- a/lib/channel.c +++ b/lib/channel.c @@ -79,6 +79,7 @@ uint8_t _channel_open(sxlink_t *co, uint16_t *chid) chan->link = co; chan->rpc_list = rpclist; chan->flags = 0; + chan->type_id = typeid; pthread_mutex_lock(&co->idx_ch_lock); chidx = idx_allocate(&co->idx_ch); @@ -172,6 +173,7 @@ sxchnl_t *sxchannel_open(sxlink_t *co, int type) /* ok all is fine */ chan->cid = msg->mhead.reserve; + chan->type_id = type; ccid = chan->cid; pthread_mutex_lock(&co->idx_ch_lock); idx_reserve(&co->idx_ch, ccid);