tmp some debug prints...

FossilOrigin-Name: 311aafde6350c9399cda9e3296e4bdada1278afecb8a0405a85ca36468994e1b
This commit is contained in:
7u83@mail.ru 2016-03-07 17:56:02 +00:00
parent 59f2ceffbd
commit 260b0f953f
5 changed files with 28 additions and 13 deletions

View File

@ -110,7 +110,7 @@ int cw_send_response(struct conn *conn, uint8_t * rawmsg, int len)
* was received or something else happened.
* @param conn conection
* @param rawmsg the received request message, which the response belongs to
* @pqram result_code result code to send
* @param result_code result code to send
* @return 1
*/
int cw_send_error_response(struct conn *conn, uint8_t * rawmsg, uint32_t result_code)
@ -332,16 +332,22 @@ static int process_elements(struct conn *conn, uint8_t * rawmsg, int len,
int result_code = 0;
if (afm->end) {
result_code = afm->end(conn, afm, rawmsg, len, from);
printf("result code comes from afm->end %d\n",result_code);
}
printf("Unrecognized = %d\n",unrecognized);
if (unrecognized){
cw_dbg(DBG_RFC,"Message has %d unrecognized message elements.",unrecognized);
if (!result_code) {
printf("Seeting result code to unrec");
result_code = CW_RESULT_UNRECOGNIZED_MESSAGE_ELEMENT;
}
}
printf("The Result COde is here %d\n",result_code);
/* if we've got a request message, we always have to send a response message */
if (as.msg_id & 1) {
if (result_code > 0) {

View File

@ -250,8 +250,6 @@ static cw_action_in_t actions_in[] = {
,
/* Vendor Specific Payload - Join Request*/
{
.capwap_state = CW_STATE_JOIN,
@ -268,7 +266,6 @@ static cw_action_in_t actions_in[] = {
.elem_id = CW_ELEM_MAXIMUM_MESSAGE_LENGTH,
.start = cw_in_generic2,
.item_id = CW_ITEM_MAXIMUM_MESSAGE_LENGTH,
.mand = 0,
.min_len = 2,
.max_len = 2
}
@ -282,10 +279,22 @@ static cw_action_in_t actions_in[] = {
{
.capwap_state = CW_STATE_CONFIGURE,
.msg_id = CW_MSG_CONFIGURATION_STATUS_REQUEST,
// .end = cw_in_check_join_req
.end = cw_in_check_generic_resp
}
,
{
.capwap_state = CW_STATE_CONFIGURE,
.msg_id = CW_MSG_CONFIGURATION_STATUS_REQUEST,
.elem_id = CW_ELEM_AC_NAME,
.item_id = CW_ITEM_AC_NAME,
.start = cw_in_generic2,
.min_len = 1,
.max_len = 512,
.mand = 1
}
,

View File

@ -325,7 +325,7 @@ static cw_action_out_t actions_out[] = {
}
,
/* Radio Admin State - Config Status Request */
{
/* {
.msg_id = CW_MSG_CONFIGURATION_STATUS_REQUEST,
.item_id = CW_ITEM_RADIO_ADMINISTRATIVE_STATE,
.out = cw_out_radio_administrative_states,
@ -333,6 +333,7 @@ static cw_action_out_t actions_out[] = {
.mand = 1
}
,
*/

View File

@ -1,13 +1,6 @@
{
"ecn_support":"0",
"location_data":"Superposition",
"result_code":"21",
"wtp_board_data":{
"model_no":"W-FAT",
"serial_no":"0000",
"vendor_id":"11591",
"wtp_board_macadddress":""
},
"wtp_bootloader_version":"11591,W-FAT-BL-0.1",
"wtp_hardware_version":"11591,0.1",
"wtp_name":"WFAT-004A9902FAC0",

View File

@ -2,6 +2,7 @@
#include "cw/capwap.h"
#include "cw/conn.h"
#include "cw/log.h"
#include "cw/mbag.h"
#include "wtp_interface.h"
#include "cfg.h"
@ -10,8 +11,13 @@ int configure()
{
struct conn *conn = get_conn();
mbag_del_all(conn->incomming);
int rc = cw_send_request(conn, CW_MSG_CONFIGURATION_STATUS_REQUEST);
printf("Configure RC: %d\n",rc);
if (!cw_rcok(rc)) {
if (rc > 0) {
cw_log(LOG_ERR,