added ZAP_COMMNAD_SET_LINK_STATUS for wanpipe boards

git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@868 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Moises Silva 2009-11-16 16:51:58 +00:00
parent c332cceb0d
commit 3fee1f6eb1
2 changed files with 32 additions and 6 deletions

View File

@ -296,6 +296,7 @@ typedef enum {
ZAP_COMMAND_FLUSH_RX_BUFFERS,
ZAP_COMMAND_FLUSH_BUFFERS,
ZAP_COMMAND_SET_PRE_BUFFER_SIZE,
ZAP_COMMAND_SET_LINK_STATUS,
ZAP_COMMAND_COUNT
} zap_command_t;
@ -415,6 +416,12 @@ struct zap_state_map {
};
typedef struct zap_state_map zap_state_map_t;
typedef enum zap_hw_link_status {
ZAP_HW_LINK_UNINITIALIZED = 0,
ZAP_HW_LINK_DISCONNECTED,
ZAP_HW_LINK_CONNECTED
} zap_hw_link_status_t;
typedef struct zap_channel zap_channel_t;
typedef struct zap_event zap_event_t;
typedef struct zap_sigmsg zap_sigmsg_t;

View File

@ -584,17 +584,36 @@ static ZIO_COMMAND_FUNCTION(wanpipe_command)
case ZAP_COMMAND_GET_CAS_BITS:
{
#ifdef LIBSANGOMA_VERSION
unsigned char rbsbits;
err = sangoma_tdm_read_rbs(zchan->sockfd, &tdm_api, zchan->physical_chan_id, &rbsbits);
if (!err) {
ZAP_COMMAND_OBJ_INT = wanpipe_swap_bits(rbsbits);
}
unsigned char rbsbits;
err = sangoma_tdm_read_rbs(zchan->sockfd, &tdm_api, zchan->physical_chan_id, &rbsbits);
if (!err) {
ZAP_COMMAND_OBJ_INT = wanpipe_swap_bits(rbsbits);
}
#else
// does sangoma_tdm_read_rbs is available here?
// does sangoma_tdm_read_rbs is available here?
ZAP_COMMAND_OBJ_INT = zchan->rx_cas_bits;
#endif
}
break;
case ZAP_COMMAND_SET_LINK_STATUS:
{
zap_hw_link_status_t status = ZAP_COMMAND_OBJ_INT;
char sangoma_status;
switch (status) {
case ZAP_HW_LINK_UNINITIALIZED:
sangoma_status = FE_UNITIALIZED;
break;
case ZAP_HW_LINK_DISCONNECTED:
sangoma_status = FE_DISCONNECTED;
break;
case ZAP_HW_LINK_CONNECTED:
sangoma_status = FE_CONNECTED;
break;
default:
return ZAP_FAIL;
}
err = sangoma_tdm_set_fe_status(zchan->sockfd, &tdm_api, status);
}
default:
break;
};