Skip to content
Snippets Groups Projects
Commit 70b7f287 authored by dmitriy.gerasimov's avatar dmitriy.gerasimov
Browse files

[+] set active channels list

parent b2a861ca
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <unistd.h> #include <unistd.h>
#include "dap_common.h" #include "dap_common.h"
#include "dap_strfuncs.h"
#include "dap_http_client.h" #include "dap_http_client.h"
#include "dap_client.h" #include "dap_client.h"
#include "dap_client_pvt.h" #include "dap_client_pvt.h"
...@@ -109,6 +110,19 @@ const char* dap_client_get_uplink_addr(dap_client_t * a_client) ...@@ -109,6 +110,19 @@ const char* dap_client_get_uplink_addr(dap_client_t * a_client)
return DAP_CLIENT_PVT(a_client)->uplink_addr; return DAP_CLIENT_PVT(a_client)->uplink_addr;
} }
/**
* @brief dap_client_set_active_channels
* @param a_client
* @param a_active_channels
*/
void dap_client_set_active_channels (dap_client_t * a_client, const char * a_active_channels)
{
if ( DAP_CLIENT_PVT(a_client)->active_channels )
DAP_DELETE(DAP_CLIENT_PVT(a_client)->active_channels );
DAP_CLIENT_PVT(a_client)->active_channels = dap_strdup( a_active_channels);
}
/** /**
* @brief dap_client_get_uplink_port * @brief dap_client_get_uplink_port
* @param a_client * @param a_client
......
...@@ -128,6 +128,7 @@ const char * dap_client_get_auth_cookie(dap_client_t * a_client); ...@@ -128,6 +128,7 @@ const char * dap_client_get_auth_cookie(dap_client_t * a_client);
dap_stream_t * dap_client_get_stream(dap_client_t * a_client); dap_stream_t * dap_client_get_stream(dap_client_t * a_client);
dap_stream_ch_t * dap_client_get_stream_ch(dap_client_t * a_client, uint8_t a_ch_id); dap_stream_ch_t * dap_client_get_stream_ch(dap_client_t * a_client, uint8_t a_ch_id);
const char * dap_client_get_stream_id(dap_client_t * a_client); const char * dap_client_get_stream_id(dap_client_t * a_client);
void dap_client_set_active_channels (dap_client_t * a_client, const char * a_active_channels);
dap_client_stage_t dap_client_get_stage(dap_client_t * a_client); dap_client_stage_t dap_client_get_stage(dap_client_t * a_client);
dap_client_stage_status_t dap_client_get_stage_status(dap_client_t * a_client); dap_client_stage_status_t dap_client_get_stage_status(dap_client_t * a_client);
......
...@@ -114,6 +114,8 @@ void dap_client_pvt_delete(dap_client_pvt_t * a_client_pvt) ...@@ -114,6 +114,8 @@ void dap_client_pvt_delete(dap_client_pvt_t * a_client_pvt)
{ {
if(a_client_pvt->session_key_id) if(a_client_pvt->session_key_id)
DAP_DELETE(a_client_pvt->session_key_id); DAP_DELETE(a_client_pvt->session_key_id);
if ( a_client_pvt->active_channels )
DAP_DELETE(a_client_pvt->active_channels );
if (a_client_pvt->session_key) if (a_client_pvt->session_key)
dap_enc_key_delete(a_client_pvt->session_key); dap_enc_key_delete(a_client_pvt->session_key);
if (a_client_pvt->session_key_open) if (a_client_pvt->session_key_open)
...@@ -247,7 +249,11 @@ static void s_stage_status_after(dap_client_pvt_t * a_client_pvt) ...@@ -247,7 +249,11 @@ static void s_stage_status_after(dap_client_pvt_t * a_client_pvt)
break; break;
case STAGE_STREAM_CONNECTED: { case STAGE_STREAM_CONNECTED: {
log_it(L_INFO, "Go to stage STAGE_STREAM_CONNECTED"); log_it(L_INFO, "Go to stage STAGE_STREAM_CONNECTED");
dap_stream_ch_new(a_client_pvt->stream, 'N'); size_t count_channels = strlen( a_client_pvt->active_channels ) ;
for(size_t i = 0; i < count_channels; i++) {
dap_stream_ch_new(a_client_pvt->stream,(uint8_t) a_client_pvt->active_channels[i]);
//sid->channel[i]->ready_to_write = true;
}
char* l_full_path = NULL; char* l_full_path = NULL;
const char * l_path = "stream"; const char * l_path = "stream";
......
...@@ -54,6 +54,7 @@ typedef struct dap_client_internal ...@@ -54,6 +54,7 @@ typedef struct dap_client_internal
char * last_parsed_node; char * last_parsed_node;
char * uplink_addr; char * uplink_addr;
char * active_channels;
uint16_t uplink_port; uint16_t uplink_port;
uint32_t uplink_protocol_version; uint32_t uplink_protocol_version;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment