Commit 4455c072 authored by Fang-WANG's avatar Fang-WANG

update Json to client

parent a828d6ba
......@@ -60,7 +60,7 @@ __minimal_destroy_message(void *_msg)
}
struct per_vhost_data__minimal *first_vhd = NULL;
int update_client(int len, char* payload)
int update_client(int len, const char* payload)
{
lwsl_user("update_client %d. \n",len);
first_vhd->amsg.len = len;
......@@ -151,7 +151,7 @@ callback_minimal(struct lws *wsi, enum lws_callback_reasons reason,
memcpy((char *)vhd->amsg.payload + LWS_PRE, in, len);
vhd->current++;
update_client(4,"1234");
//update_client(9,"init test");
// /*
// * let everybody know we want to write something on them
// * as soon as they are ready
......
......@@ -1274,7 +1274,7 @@ evsub_id_t smf_app::handle_event_exposure_subscription(
}
extern "C" {
int update_client(int len, char* payload);
int update_client(int len, const char* payload);
}
//------------------------------------------------------------------------------
bool smf_app::handle_nf_status_notification(
......@@ -1295,7 +1295,10 @@ bool smf_app::handle_nf_status_notification(
Logger::smf_app().debug(
"handle_nf_status_notification NF %s is %s !", profile.get()->get_nf_type().c_str(), event_type.c_str());
update_client(6,"asdfdd");
nlohmann::json json_data = {};
json_data["nfStatus"] = event_type.c_str();
json_data["nfType"] = profile.get()->get_nf_type().c_str();
update_client(json_data.dump().length(),json_data.dump().c_str());
return true;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment