Host code for alert

This commit is contained in:
swateeshrivastava
2019-03-04 15:27:40 +05:30
parent eb22ea8c55
commit 8a070266a5
22 changed files with 42906 additions and 774 deletions

View File

@@ -141,6 +141,7 @@ SCHEMA_IMPORT const DriverStruct fact_sdr_fpga_adt7481_cfg;
SCHEMA_IMPORT const DriverStruct fact_sdr_fpga_ps_cfg;
SCHEMA_IMPORT const DriverStruct fact_sync_ts_cfg;
SCHEMA_IMPORT bool alert_log(void *, void *);
SCHEMA_IMPORT bool GPP_ap_Reset(void *, void *);
SCHEMA_IMPORT bool gpp_post_init(void *, void *);
SCHEMA_IMPORT bool gpp_pre_init(void *, void *);
@@ -167,7 +168,6 @@ const Component sys_schema[] = {
.name = "system",
.driver_cfg = &gbc_spi_flash_memory,
.ssHookSet = &(SSHookSet) {
.preInitFxn = NULL,
.postInitFxn = (ssHook_Cb)sys_post_init,
},
.components = (Component[]) {
@@ -206,6 +206,10 @@ const Component sys_schema[] = {
.name = "echo",
.cb_cmd = SYS_cmdEcho,
},
{
.name = "getAlertLogs",
.cb_cmd = alert_log,
},
{}
},
},
@@ -226,6 +230,13 @@ const Component sys_schema[] = {
},
{}
},
.commands = (Command[]) {
{
.name = "getAlertLogs",
.cb_cmd = alert_log,
},
{}
},
},
{
.name = "leadacid_sensor",
@@ -283,6 +294,13 @@ const Component sys_schema[] = {
{
.name = "comp_all",
.postDisabled = POST_DISABLED,
.commands = (Command[]) {
{
.name = "getAlertLogs",
.cb_cmd = alert_log,
},
{}
},
},
{
.name = "ec",
@@ -321,6 +339,13 @@ const Component sys_schema[] = {
{
.name = "comp_all",
.postDisabled = POST_DISABLED,
.commands = (Command[]) {
{
.name = "getAlertLogs",
.cb_cmd = alert_log,
},
{}
},
},
{
.name = "led",
@@ -354,6 +379,13 @@ const Component sys_schema[] = {
{
.name = "comp_all",
.postDisabled = POST_DISABLED,
.commands = (Command[]) {
{
.name = "getAlertLogs",
.cb_cmd = alert_log,
},
{}
},
},
{
.name = "port0",
@@ -409,6 +441,13 @@ const Component sys_schema[] = {
{
.name = "comp_all",
.postDisabled = POST_DISABLED,
.commands = (Command[]) {
{
.name = "getAlertLogs",
.cb_cmd = alert_log,
},
{}
},
},
{
.name = "ap",
@@ -445,6 +484,10 @@ const Component sys_schema[] = {
.name = "reset",
.cb_cmd = GPP_ap_Reset,
},
{
.name = "getAlertLogs",
.cb_cmd = alert_log,
},
{}
},
},
@@ -493,6 +536,10 @@ const Component sys_schema[] = {
.name = "reset",
.cb_cmd = SDR_reset,
},
{
.name = "getAlertLogs",
.cb_cmd = alert_log,
},
{}
},
},
@@ -554,6 +601,10 @@ const Component sys_schema[] = {
.name = "reset",
.cb_cmd = RFFE_reset,
},
{
.name = "getAlertLogs",
.cb_cmd = alert_log,
},
{}
},
},
@@ -708,6 +759,10 @@ const Component sys_schema[] = {
.name = "reset",
.cb_cmd = SYNC_reset,
},
{
.name = "getAlertLogs",
.cb_cmd = alert_log,
},
{}
},
.postDisabled = POST_DISABLED,

File diff suppressed because it is too large Load Diff

View File

@@ -12,44 +12,66 @@
#include <syslog.h>
#include <libgen.h>
#define __filename__ (basename(__FILE__))
#define __filename__ (basename(__FILE__))
#ifdef CONSOLE_LOG
#define logit(facility, fmt, ...) \
{ \
if(facility != LOG_DEBUG) \
printf(fmt "\n", ##__VA_ARGS__); \
else \
printf ("[%s:%d, %s()]:" fmt "\n", __filename__, \
__LINE__, __func__, ##__VA_ARGS__); \
}
#else /* syslog */
#define logit(facility, fmt, ...) \
{ \
if(facility != LOG_DEBUG) \
syslog(facility, fmt "\n", ##__VA_ARGS__); \
else \
syslog(facility, "<d> [%s:%d, %s()]: " fmt "\n", \
__filename__, __LINE__, __func__, ##__VA_ARGS__); \
}
# define logit(facility, fmt, ...) \
{ \
if (facility != LOG_DEBUG) \
printf(fmt "\n", ##__VA_ARGS__); \
else \
printf("[%s:%d, %s()]:" fmt "\n", __filename__, __LINE__, \
__func__, ##__VA_ARGS__); \
}
#elif SYS_LOG /* syslog */
# define logit(facility, fmt, ...) \
{ \
if (facility != LOG_DEBUG) \
syslog(facility, fmt "\n", ##__VA_ARGS__); \
else \
syslog(facility, "<d> [%s:%d, %s()]: " fmt "\n", __filename__, \
__LINE__, __func__, ##__VA_ARGS__); \
}
#elif OCCLI_LOG
# define logit(facility, fmt, ...) \
{ \
FILE *fp; \
fp = fopen("./log/logFileOccli.txt", "a"); \
if (facility != LOG_DEBUG) \
fprintf(fp, fmt "\n", ##__VA_ARGS__); \
else \
fprintf(fp, "[%s:%d, %s()]:" fmt "\n", __filename__, __LINE__, \
__func__, ##__VA_ARGS__); \
fclose(fp); \
}
#else
# define logit(facility, fmt, ...) \
{ \
FILE *fp; \
fp = fopen("./log/logFileMW.txt", "a"); \
if (facility != LOG_DEBUG) \
fprintf(fp, fmt "\n", ##__VA_ARGS__); \
else \
fprintf(fp, "[%s:%d, %s()]:" fmt "\n", __filename__, __LINE__, \
__func__, ##__VA_ARGS__); \
fclose(fp); \
}
#endif
#define logemerg(fmt, ...) logit(LOG_EMERG, "<E> " fmt, ##__VA_ARGS__)
#define logalert(fmt, ...) logit(LOG_ALERT, "<A> " fmt, ##__VA_ARGS__)
#define logcrit(fmt, ...) logit(LOG_CRIT, "<C> " fmt, ##__VA_ARGS__)
#define logerr(fmt, ...) logit(LOG_ERR, "<e> " fmt, ##__VA_ARGS__)
#define logwarn(fmt, ...) logit(LOG_WARNING, "<w> " fmt, ##__VA_ARGS__)
#define lognotice(fmt, ...) logit(LOG_NOTICE, "<n> " fmt, ##__VA_ARGS__)
#define loginfo(fmt, ...) logit(LOG_INFO, "<i> " fmt, ##__VA_ARGS__)
#define logdebug(fmt, ...) logit(LOG_DEBUG, fmt, ##__VA_ARGS__)
#define logemerg(fmt, ...) logit(LOG_EMERG, "<E> " fmt, ##__VA_ARGS__)
#define logalert(fmt, ...) logit(LOG_ALERT, "<A> " fmt, ##__VA_ARGS__)
#define logcrit(fmt, ...) logit(LOG_CRIT, "<C> " fmt, ##__VA_ARGS__)
#define logerr(fmt, ...) logit(LOG_ERR, "<e> " fmt, ##__VA_ARGS__)
#define logwarn(fmt, ...) logit(LOG_WARNING, "<w> " fmt, ##__VA_ARGS__)
#define lognotice(fmt, ...) logit(LOG_NOTICE, "<n> " fmt, ##__VA_ARGS__)
#define loginfo(fmt, ...) logit(LOG_INFO, "<i> " fmt, ##__VA_ARGS__)
#define logdebug(fmt, ...) logit(LOG_DEBUG, fmt, ##__VA_ARGS__)
/*
* @param ident an input value (by pointer)
*
*/
extern void initlog(const char* ident);
extern void initlog(const char *ident);
/*
* deinitialize the logging routine
*

View File

@@ -16,7 +16,7 @@
#define HIT_FILE_BUFF_SIZE 50
#define OCCLI_STRING_SIZE 128
#define RES_STR_BUFF_SIZE 10000
#define RES_STR_BUFF_SIZE 100000
#define OCMP_MAX_SIZE 10
#define OCCLI_CHAR_ARRAY_SIZE 30
#define OCMW_MAX_SUBSYSTEM 11
@@ -119,8 +119,7 @@ extern int32_t occli_recv_alertmsg_from_ocmw(char *resp, int32_t resplen);
*
* @return true if function succeeds, false otherwise
*/
extern int32_t ocmw_parse_msgframe(const Component *root,
strMsgFrame *msgFrame,
extern int32_t ocmw_parse_msgframe(const Component *root, strMsgFrame *msgFrame,
uint8_t actiontype,
ocmwSchemaSendBuf *ecSendBuf);
/*
@@ -186,9 +185,19 @@ extern void ocmw_free_global_pointer(void **ptr);
*
* @return true if function succeeds, false otherwise
*/
extern int8_t occli_printHelpMenu(const Component *root,char *cmd);
extern int8_t occli_printHelpMenu(const Component *root, char *cmd);
/*Display CLI window*/
extern void occli_print_opencelluar();
/*
* @param root an output value (by pointer)
* @param systemInfo an output value (by pointer)
*
* @return true if function succeeds, false otherwise
*/
extern void ocmw_handle_alert_msg(const Component *compBase,
OCMPMessageFrame *ecReceivedMsg,
int8_t *alertRecord);
#endif /* _OCCLI_COMM_H_ */

View File

@@ -21,7 +21,7 @@ sem_t semCommandPost;
#define OCMW_BUSY_WAIT_INDEX 0
#define OCMW_TIMED_WAIT_INDEX 1
#define PARAM_STR_MAX_BUFF_SIZE 100
#define ALERT_MAX_BUFF_SIZE 400
extern int32_t ocmw_init();
/*
* @param actionType an input enum value (by value)

View File

@@ -39,6 +39,9 @@
#define PARAM_STR_BUFF_SIZE 100
#define PARAM_TYPE_BUFF_SIZE 32
#define OCMW_ALERT_ACTION_SIZE 12
#define OCMW_ALERT_DATE_SIZE 24
#define OCMW_ALERT_STRING_SIZE 64
#define OCMW_MAX_SUBSYSTEM_SIZE 16
#define OCMW_MAX_ACTION_SIZE 16
#define OCMW_MAX_MSGTYPE_SIZE 16
@@ -117,6 +120,24 @@ typedef struct {
char desc[OCMW_POST_DESC_SIZE]; /* Device description */
} ocwarePostReplyCode;
typedef struct alertevent {
char string[OCMW_ALERT_STRING_SIZE]; /* alert string */
char action[OCMW_ALERT_ACTION_SIZE]; /* ACTIVE / CLEAR */
char value[OCMW_ALERT_STRING_SIZE];
} alertevent;
typedef struct allAlertEvent {
char string[OCMW_ALERT_STRING_SIZE]; /* alert string */
char action[OCMW_ALERT_ACTION_SIZE]; /* ACTIVE / CLEAR */
char datetime[OCMW_ALERT_DATE_SIZE]; /* YYYY-MM-DD hh:mm:ss */
char value[OCMW_ALERT_STRING_SIZE];
char actualValue[OCMW_ALERT_STRING_SIZE];
} allAlertEvent;
typedef struct alertlist {
uint16_t nalerts; /* Number of alerts */
struct allAlertEvent *list; /* Alert list */
} alertlist;
/*
* @param sem an input value (by pointer)
*
@@ -170,4 +191,12 @@ extern int32_t ocmw_parse_obc_from_ec(ocmwSendRecvBuf ecInputData);
* @return true if function succeeds, false otherwise
*/
extern int32_t ocmw_parse_testingmodule_from_ec(ocmwSendRecvBuf ecInputData);
/*
* @param msgaction an input value (by value)
* @param msgtype an input value (by value)
* @param paramstr an input string (by pointer)
* @param paramvalue an input value (by pointer)
*
*/
extern int32_t ocmw_handle_show_alerts(char *response);
#endif /* _OCMW_HELPER_H_ */

View File

@@ -13,9 +13,11 @@
#define PARAMSTR_NUMBER_LEN 12
#define TESTMOD_MAX_LEN 16
#define RES_STR_BUFF_SIZE 10000
#define RES_STR_BUFF_SIZE 100000
#define RES_ALERT_STR_BUFF_SIZE 1000
#define TEMP_STR_BUFF_SIZE 100
#define ALERT_STR_BUFF_SIZE 128
#define FINAL_STR_BUFF_SIZE 100
#define ALERT_STR_BUFF_SIZE 200
#define CMD_STR_BUFF_SIZE 100
#define OCMW_MAX_IMEI_SIZE 15
#define OCMW_MAX_MSG_SIZE 20
@@ -62,6 +64,7 @@ typedef enum {
EPKTGEN_STR,
DPKTGEN_STR,
ECLIENT_STR,
ALERTLOG_STR,
MAX_STR
} ocmw_token_t;

View File

@@ -1,5 +1,6 @@
/* OC Includes */
#include <occli_common.h>
#include <ocmw_core.h>
#ifndef _OCMW_SCHEMA_H_
#define _OCMW_SCHEMA_H_

View File

@@ -116,6 +116,15 @@ typedef enum ocware_ret{
STUB_SUCCESS = 0
} ocware_stub_ret;
typedef struct {
uint8_t subsystemId;
uint8_t componentId;
uint8_t msgtype;
uint16_t paramId;
uint8_t paramSize;
uint8_t datatype;
void *data;
} OCWareStubAlertData;
extern int8_t debugGetCommand;
extern int8_t debugSetCommand;
@@ -142,7 +151,8 @@ extern ocware_stub_ret ocware_stub_parse_post_get_message(char *buffer);
* @return STUB_SUCCESS - for success
* STUB_FAILED - for failure
******************************************************************************/
extern ocware_stub_ret ocware_stub_parse_command_message(char *buffer);
extern ocware_stub_ret ocware_stub_parse_command_message(char *buffer,
uint8_t *alertFlag);
/******************************************************************************
* Function Name : ocware_stub_get_set_params
@@ -262,5 +272,53 @@ extern ocware_stub_ret ocware_stub_parse_debug_actiontype(OCMPMessage *msgFrameD
******************************************************************************/
extern ocware_stub_ret ocware_stub_get_post_database(OCMPMessage *msgFrameData,
char *payload);
/******************************************************************************
* Function Name : ocware_stub_parse_alert_get_message
* Description : Parse alert messages from MW
*
* @param buffer - output pointer to the message from MW
* index - index for record
*
* @return STUB_SUCCESS - for success
* STUB_FAILED - for failure
******************************************************************************/
extern ocware_stub_ret ocware_stub_parse_alert_get_message(char *buffer,
int8_t index);
/******************************************************************************
* Function Name : ocware_stub_get_alert_database
* Description : extract alert data from lookup table
*
* @param msgFrameData - output pointer to the OCMPheader field of the message
* from MW (by reference)
* @param payload - output pointer to the payload field of the message from MW
*
* @return STUB_SUCCESS - for success
* STUB_FAILED - for failure
******************************************************************************/
extern ocware_stub_ret ocware_stub_get_alert_database(OCMPMessage *msgFrameData,
char *payload,
int8_t index);
/******************************************************************************
* Function Name : ocware_stub_parse_command_from_schema
* Description : parse command from schema
*
* @param msgFrameData - pointer to the OCMPheader field of the message
* from MW (by reference)
*
* @return tempAlertFlag
******************************************************************************/
extern uint8_t ocware_stub_parse_command_from_schema(OCMPMessage *msgFrameData);
/******************************************************************************
* Function Name : ocware_stub_frame_alert_msgframe
* Description : extract alert data from based on subsystem
*
* @param msgFrameData - output pointer to the OCMPheader field of the message
* from MW (by reference)
* @param payload - output pointer to the payload field of the message from MW
*
* @return STUB_SUCCESS - for success
* STUB_FAILED - for failure
******************************************************************************/
extern ocware_stub_ret ocware_stub_frame_alert_msgframe(char *buffer);
#endif /* __OCMW_STUB_H__ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,25 @@
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]
<e> Error: 'recvfrom' [-1-Resource temporarily unavailable]

View File

@@ -328,8 +328,6 @@ static int8_t occli_strjoin(char **deststrPtr, const char *srcstr,
/* strcat the new string */
strcat(*deststrPtr, srcstr);
logdebug("*deststrPtr='%s'", *deststrPtr);
return SUCCESS;
}
@@ -371,6 +369,9 @@ int8_t occli_parse_cliString(char *cliString)
char tempStr[OCCLI_STRING_MAX_LEN] = {0};
char *token = NULL;
if (cliString == NULL) {
return ret;
}
strcpy(tempStr, cliString);
token = strtok(tempStr, " ");
@@ -735,6 +736,11 @@ int32_t main(int32_t argc, char *argv[])
return FAILED;
}
ret = pthread_create(&alertThreadId, NULL,
occli_alertthread_messenger_to_ocmw, NULL);
if (ret != 0) {
return ret;
}
/* Execute the OC command (argv[1:]) and exit */
if (strcmp("occmd", basename(argv[0])) == 0) {
for (index= 1; index < argc; index++) {
@@ -752,7 +758,6 @@ int32_t main(int32_t argc, char *argv[])
}
if (cmdstr != NULL) {
logdebug("cmdstr='%s'", cmdstr);
occli_send_cmd_to_ocmw(cmdstr, strlen(cmdstr));
memset(response, 0, sizeof(response));
occli_recv_cmd_resp_from_ocmw(response, sizeof(response));
@@ -765,12 +770,6 @@ int32_t main(int32_t argc, char *argv[])
}
/* Entering interactive CLI */
else if (strcmp("occli", basename(argv[0])) == 0) {
ret = pthread_create(&alertThreadId, NULL,
occli_alertthread_messenger_to_ocmw, NULL);
if (ret != 0) {
return ret;
}
/* Initialize readline */
using_history();

View File

@@ -36,6 +36,8 @@ extern uint8_t ocwarePostArrayIndex;
debugI2CData I2CInfo;
debugMDIOData MDIOInfo;
ethTivaClient clientInfo;
int8_t alertFlag = 0;
alertlist alerts;
struct matchString {
const char *key;
@@ -59,6 +61,7 @@ struct matchString {
{ "en_pktGen", EPKTGEN_STR },
{ "dis_pktGen", DPKTGEN_STR },
{ "en_tivaClient", ECLIENT_STR },
{ "getAlertLogs", ALERTLOG_STR },
{ NULL, MAX_STR },
};
@@ -199,6 +202,129 @@ int32_t ocmw_check_numeric_number(char *numstring)
}
return SUCCESS;
}
/**************************************************************************
* Function Name : ocmw_frame_alert_response
* Description : This Function used to frame alert response
* Input(s) : alerts
* Output(s) : response
***************************************************************************/
int32_t ocmw_frame_alert_response(char *response)
{
int32_t index = 0;
char alertstr[ALERT_MAX_BUFF_SIZE] = {0};
if (response == NULL) {
logerr("%s(): NULL pointer error", __func__);
return FAILED;
}
strncpy(response,
"-------------------------------------------------------"
"------------------------------------------------\n",
ALERT_STR_BUFF_SIZE);
if (snprintf(alertstr, ALERT_STR_BUFF_SIZE, "%-52s%-19s%-8s%-7s%-5s\n",
"ALERT DESCRIPTION", "TIME", "STATUS", "LIMIT",
"ACTUAL_VALUE") < 0) {
return FAILED;
}
strncat(response, alertstr, ALERT_STR_BUFF_SIZE);
if ((snprintf(alertstr, ALERT_STR_BUFF_SIZE,
"-----------------------------------------------------------"
"--------------------------------------------\n")) < 0) {
return FAILED;
}
strncat(response, alertstr, ALERT_STR_BUFF_SIZE);
for (index = 0; index < alerts.nalerts + 1; index++) {
if (snprintf(alertstr, ALERT_STR_BUFF_SIZE, "%-52s%-19s%-8s%-7s%-5s\n",
alerts.list[index].string, alerts.list[index].datetime,
alerts.list[index].action, alerts.list[index].value,
alerts.list[index].actualValue) < 0) {
return FAILED;
}
strncat(response, alertstr, ALERT_STR_BUFF_SIZE);
}
if ((snprintf(alertstr, ALERT_STR_BUFF_SIZE,
"------------------------------------------------------------"
"-------------------------------------------\n")) < 0) {
return FAILED;
}
strncat(response, alertstr, ALERT_STR_BUFF_SIZE);
return SUCCESS;
}
/**************************************************************************
* Function Name : ocmw_handle_show_alerts
* Description : This Function used to handle the alerts commands
* Input(s) : alerts
* Output(s) : response
***************************************************************************/
int32_t ocmw_handle_show_alerts(char *response)
{
int32_t ret = 0;
if (response == NULL) {
logerr("%s(): NULL pointer error", __func__);
return FAILED;
}
strncpy(response, "", RES_ALERT_STR_BUFF_SIZE);
ret = ocmw_frame_alert_response(response);
if (ret < 0) {
free(alerts.list);
return ret;
}
ret = ocmw_send_alert_to_occli(response, RES_ALERT_STR_BUFF_SIZE);
free(alerts.list);
alerts.nalerts = 0;
return ret;
}
/**************************************************************************
* Function Name : ocmw_handle_show_all_alerts
* Description : This Function used to handle the syncronous alerts
* Input(s) : strTokenArray
* Output(s) : response
***************************************************************************/
static int32_t ocmw_handle_show_all_alerts(char *strTokenArray[],
char *response)
{
char paramStr[PARAM_STR_BUFF_SIZE];
void *paramVal;
char tempParamStr[PARAM_STR_MAX_BUFF_SIZE] = { 0 };
int32_t ret = 0;
if (strTokenArray == NULL || response == NULL) {
logerr("%s(): NULL pointer error", __func__);
return FAILED;
}
alerts.nalerts = 0;
alerts.list = (struct allAlertEvent *)calloc(ALERT_MAX_BUFF_SIZE,
sizeof(struct allAlertEvent));
alertFlag++;
strcpy(tempParamStr, strTokenArray[0]);
strncpy(response, "", RES_STR_BUFF_SIZE);
if ((snprintf(paramStr, PARAM_STR_BUFF_SIZE, "%s.%s", strTokenArray[1],
strTokenArray[0])) < 0) {
return FAILED;
}
ret = ocmw_msgproc_send_msg(&strTokenArray[0], 0, OCMP_MSG_TYPE_COMMAND,
(int8_t *)paramStr, &paramVal);
if ((snprintf(response, RES_STR_BUFF_SIZE, "%s : %s", tempParamStr,
(ret != 0) ? "Failed" : "Success")) < 0) {
return FAILED;
}
if (ret < 0) {
logerr("Error in reading alerts");
}
ret = ocmw_frame_alert_response(response);
free(alerts.list);
alertFlag = 0;
alerts.nalerts = 0;
return ret;
}
/**************************************************************************
* Function Name : ocmw_handle_set_config
* Description : This Function used to handle the set config commands
@@ -916,8 +1042,8 @@ static ocmw_token_t ocmw_match_set_get_string(char *str)
static ocmw_token_t ocmw_match_string(char *str)
{
struct matchString *index = ocmwTokenTable;
for(; index->key != NULL &&
strncmp(index->key, str, strlen(index->key)) != 0; ++index);
for (; index->key != NULL && strcmp(index->key, str) != 0; ++index)
;
return index->token;
}
/**************************************************************************
@@ -1139,11 +1265,6 @@ int32_t ocmw_clicmd_handler(const char *cmdStr, char *response)
response);
ocmw_free_pointer(strTokenArray);
return (ret != 0) ? FAILED : SUCCESS;
} else if (strcmp("alerts", class) == 0) {
/* SCHEMA change :: Alert is not implimented */
/* ret = ocmw_handle_show_alerts(&strTokenArray[0], response);
ocmw_free_pointer(strTokenArray);
return (ret != 0) ? FAILED : SUCCESS;*/
} else {
if ((snprintf(response,
RES_STR_BUFF_SIZE, "[Error]: "
@@ -1285,6 +1406,22 @@ int32_t ocmw_clicmd_handler(const char *cmdStr, char *response)
return FAILED;
}
break;
case ALERTLOG_STR:
if (strTokenCount == 2) {
ret = ocmw_handle_show_all_alerts(&strTokenArray[0],
response);
ocmw_free_pointer(strTokenArray);
return (ret != 0) ? FAILED : SUCCESS;
} else {
ret = (strTokenCount < 2 ?
ocmw_frame_errorString(
cmdStr, INSUFFICIENT_PARAM, response) :
ocmw_frame_errorString(
cmdStr, INVALID_SYNTAX, response));
ocmw_free_pointer(strTokenArray);
return FAILED;
}
break;
default:
break;
}

View File

@@ -32,6 +32,8 @@ subSystemInfo systemInfo;
extern ocwarePostResultData ocwarePostArray[TEMP_STR_BUFF_SIZE];
extern uint8_t ocwarePostArrayIndex;
int8_t alertRecord = 1;
extern int8_t alertFlag;
ocwarePostReplyCode ocmwReplyCode[] = {
/* Message Type, reply code, Description */
{OCMP_MSG_TYPE_POST, POST_DEV_NOSTATUS , "POST DEV NOSTATUS"},
@@ -362,7 +364,7 @@ int32_t ocmw_msg_packetize_and_send(char * strTokenArray[], uint8_t action,
paramValLen = strlen((char *)paramVal);
if (!((msgType == OCMP_MSG_TYPE_COMMAND) &&
((strncmp(strTokenArray[1], "get", strlen("get")) == 0) ||
((strcmp(strTokenArray[1], "get")) ||
(strncmp(strTokenArray[1], "set", strlen("get")) == 0)))) {
if (paramValLen == 1 || paramValLen <= 5) {
logdebug ("Paramvalue is of integer type : %d\n", atoi( paramVal));
@@ -578,7 +580,6 @@ int32_t ocmw_msg_packetize_and_send(char * strTokenArray[], uint8_t action,
******************************************************************************/
void * ocmw_thread_uartmsgparser(void *pthreadData)
{
logdebug("Uart task created \n");
while (1) {
/* Waiting on the semecMsgParser to be released by uart */
sem_wait(&semecMsgParser);
@@ -624,6 +625,7 @@ void ocmw_ec_msgparser(void)
int32_t sendPktNonpayloadSize = 0;
sMsgParam dmsgFrameParam;
OCMPMessageFrame ecReceivedMsg;
alertRecord = 1;
sendPktNonpayloadSize = (sizeof(OCMPMessage) - sizeof(void *)
+ sizeof(OCMPHeader));
@@ -646,20 +648,20 @@ void ocmw_ec_msgparser(void)
actionType = ecReceivedMsg.message.action;
paramInfo = ecReceivedMsg.message.parameters;
/*
* TODO:Temporary fix for handling alerts
*/
if (msgType == OCMP_MSG_TYPE_ALERT) {
free(ecReceivedMsg.message.info);
return;
}
printf("Received from ec :\n");
for (indexCount = 0; indexCount < OCMP_MSG_SIZE; indexCount++) {
printf("0x%x ", mcuMsgBuf[indexCount]);
}
printf("\n");
/*
* Alerts handling
*/
if ((msgType == OCMP_MSG_TYPE_ALERT) || (alertFlag > 0)) {
ocmw_handle_alert_msg(sys_schema, &ecReceivedMsg, &alertRecord);
responseCount++;
ocmw_free_global_pointer((void**)&ecSendBufBkp);
return;
}
/* In case of timeout, return from the thread
* without processing the data to avoid sync issue.
*/
@@ -765,9 +767,20 @@ int32_t ocmw_send_msg(OCMPMessageFrame ecMsgFrame, uint8_t interface)
ret = ocmw_send_eth_msgto_ec((int8_t *) &ecMsgFrame,
OCMP_MSG_SIZE, sentDev);
#ifdef INTERFACE_STUB_EC
memset(ethRecvBuf, 0, sizeof(ethRecvBuf));
ocmw_recv_eth_msgfrom_ec(ethRecvBuf, sizeof(ethRecvBuf), OCMW_EC_STUB_DEV);
ocmw_ec_msgparser();
if (alertFlag > 0) {
while (1) {
memset(ethRecvBuf, 0, sizeof(ethRecvBuf));
ocmw_recv_eth_msgfrom_ec(ethRecvBuf,
sizeof(ethRecvBuf), OCMW_EC_STUB_DEV);
ocmw_ec_msgparser();
if (alertRecord == 0)
break;
}
} else {
memset(ethRecvBuf, 0, sizeof(ethRecvBuf));
ocmw_recv_eth_msgfrom_ec(ethRecvBuf, sizeof(ethRecvBuf), OCMW_EC_STUB_DEV);
ocmw_ec_msgparser();
}
#endif
break;

View File

@@ -11,6 +11,9 @@ static char *s_paramEnumValue[OCMW_VALUE_TYPE_MFG] = {0};
ocmwSchemaSendBuf *ecSendBufBkp;
ocwarePostResultData ocwarePostArray[TEMP_STR_BUFF_SIZE] = {{0}};
uint8_t ocwarePostArrayIndex;
extern alertlist alerts;
static uint8_t s_alertIndex = 0;
extern int8_t alertFlag;
/******************************************************************************
* Function Name : ocmw_parse_eepromdata_from_ec
* Description : parse the eeprom data coming from EC to AP
@@ -293,7 +296,236 @@ void ocmw_get_noOfElements(const Parameter *param_list, int32_t *noOfElement,
*noOfElement = elementCount;
*size = pSize;
}
/******************************************************************************
* Function Name : ocmw_get_alert_value
* Description : get the alert value from message
* Input(s) : paramtype, ecReceivedMsg
* Output(s) : recvdAlertVal
******************************************************************************/
void ocmw_get_alert_value(const Parameter *param, const char* paramtype,
char *alertVal, char *alertVal1, OCMPMessageFrame *ecReceivedMsg)
{
int8_t paramPos = 7;
int32_t recvdAlertVal = 0;
int32_t recvdAlertVal1 = 0;
char *alertEnumValue[2] = {0};
char regStr[BUF_SIZE] = {0};
char regStr1[BUF_SIZE] = {0};
int8_t enumCount = 0;
int8_t strCount = 0;
int8_t index = 0;
if ((param == NULL) || (paramtype == NULL)) {
logdebug("Invalid paramtype\n");
return ;
}
if (strcmp("uint16",paramtype) == 0) {
recvdAlertVal = *((uint16_t *)
&(ecReceivedMsg->message.info[paramPos]));
recvdAlertVal1 = *((uint16_t *)
&(ecReceivedMsg->message.info[paramPos + 2]));
} else if (strcmp("int16",paramtype) == 0) {
recvdAlertVal = *((int16_t *)
&(ecReceivedMsg->message.info[paramPos]));
recvdAlertVal1 = *((int16_t *)
&(ecReceivedMsg->message.info[paramPos + 2]));
} else if (strcmp("uint8",paramtype) == 0) {
recvdAlertVal = *((uint8_t *)
&(ecReceivedMsg->message.info[paramPos]));
recvdAlertVal1 = *((uint8_t *)
&(ecReceivedMsg->message.info[paramPos + 2]));
} else if (strcmp("string",paramtype) == 0) {
memcpy(regStr, &ecReceivedMsg->message.info[paramPos], param->size);
memcpy(regStr1, &ecReceivedMsg->message.info[paramPos + 2],
param->size);
strCount++;
}
if (enumCount) {
sprintf(alertVal, "%u(%s)", recvdAlertVal, regStr);
sprintf(alertVal1, "%u(%s)", recvdAlertVal1, regStr1);
} else if (strCount) {
sprintf(alertVal, "%s", regStr);
sprintf(alertVal1, "%s", regStr1);
} else {
sprintf(alertVal, "%u", recvdAlertVal);
sprintf(alertVal1, "%u", recvdAlertVal1);
}
for (index = 0; index < enumCount; index++) {
ocmw_free_global_pointer((void**)&alertEnumValue[index]);
}
return;
}
/******************************************************************************
* Function Name : ocmw_extract_dateTime_from_msgFrame
* Description : extract date time for alerts
* Input(s) : ecReceivedMsg
* Output(s) :
******************************************************************************/
void ocmw_extract_dateTime_from_msgFrame(OCMPMessageFrame *ecReceivedMsg)
{
uint8_t hour = 0;
uint8_t minuts = 0;
uint8_t second = 0;
uint8_t day = 0;
uint8_t month = 0;
uint8_t year = 0;
int8_t paramPos = 1;
hour = *((uint8_t *)
&(ecReceivedMsg->message.info[paramPos]));
minuts = *((uint8_t *)
&(ecReceivedMsg->message.info[paramPos + 1]));
second = *((uint8_t *)
&(ecReceivedMsg->message.info[paramPos + 2]));
day = *((uint8_t *)
&(ecReceivedMsg->message.info[paramPos + 3]));
month = *((uint8_t *)
&(ecReceivedMsg->message.info[paramPos + 4]));
year = *((uint8_t *)
&(ecReceivedMsg->message.info[paramPos + 5]));
sprintf(alerts.list[s_alertIndex].datetime, "%d:%d:%d %d/%d/20%d",
hour, minuts, second, day, month, year);
return;
}
/******************************************************************************
* Function Name : ocmw_handle_alert_msg
* Description : parse schema for alert message
* Input(s) : compBase, ecReceivedMsg
* Output(s) :
******************************************************************************/
void ocmw_handle_alert_msg(const Component *compBase,
OCMPMessageFrame *ecReceivedMsg, int8_t *alertRecord)
{
const Component *component = NULL;
const Component *subComponent = NULL;
const Component *subSystem = compBase;
const Driver *devDriver = NULL;
const Parameter *param = NULL;
char response[RES_STR_BUFF_SIZE] = {0};
int8_t count = 0;
int8_t countParamId = 0;
static int8_t alertCount = 0;
int8_t ret = 0;
int32_t alertElements = 0;
int32_t alertElementsTemp = 0;
int32_t size = 0;
sMsgParam *sMsgFrameParam = (sMsgParam *) malloc(sizeof(sMsgParam));
if ((subSystem == NULL) || (sMsgFrameParam == NULL)) {
logdebug("Invalid Memory\n");
return;
}
if ((alertFlag == 0) && (alerts.nalerts == 0)) {
alerts.list = (struct allAlertEvent *) calloc(ALERT_MAX_BUFF_SIZE,
sizeof(struct allAlertEvent));
}
memset(sMsgFrameParam, 0, sizeof(sMsgParam));
sMsgFrameParam->component = 1;
while (subSystem && subSystem->name) {
if (sMsgFrameParam->subsystem == ecReceivedMsg->message.subsystem) {
component = subSystem->components;
while (component && component->name) {
if (ecReceivedMsg->message.componentID ==
sMsgFrameParam->component) {
devDriver = component->driver;
if (devDriver != NULL) {
param = devDriver->alerts;
while (param && param->name) {
if(ecReceivedMsg->message.parameters ==
pow(2, countParamId)) {
sprintf(alerts.list[s_alertIndex].string,
"%s.%s.alerts.%s",
subSystem->name, component->name,
param->name);
ocmw_get_alert_value(param,
DATA_TYPE_MAP[param->type],
alerts.list[s_alertIndex].value,
alerts.list[s_alertIndex].actualValue,
ecReceivedMsg);
alertCount++;
break;
}
countParamId = countParamId + 1;
param += 1;
}
}
subComponent = component->components;
while (subComponent && subComponent->name) {
countParamId = 0;
devDriver = subComponent->driver;
if (devDriver != NULL) {
param = devDriver->alerts;
ocmw_get_noOfElements(param,&alertElements, &size);
while (param && param->name) {
if(ecReceivedMsg->message.parameters ==
pow(2, countParamId + alertElementsTemp)){
sprintf(alerts.list[s_alertIndex].string,
"%s.%s.alerts.%s.%s", subSystem->name,
component->name, subComponent->name,
param->name);
ocmw_get_alert_value(param,
DATA_TYPE_MAP[param->type],
alerts.list[s_alertIndex].value,
alerts.list[s_alertIndex].actualValue,
ecReceivedMsg);
count++;
alertCount++;
break;
}
countParamId = countParamId + 1;
param += 1;
}
}
if (count > 0)
break;
alertElementsTemp = alertElementsTemp + alertElements;
subComponent += 1;
}
break;
}
sMsgFrameParam->component += 1;
component += 1;
}
break;
}
sMsgFrameParam->subsystem += 1;
subSystem += 1;
}
if (ecReceivedMsg->message.action == OCMP_AXN_TYPE_ACTIVE) {
strcpy(alerts.list[s_alertIndex].action,"ACTIVE");
} else if (ecReceivedMsg->message.action == OCMP_AXN_TYPE_CLEAR) {
strcpy(alerts.list[s_alertIndex].action,"CLEAR");
}
ocmw_extract_dateTime_from_msgFrame(ecReceivedMsg);
logdebug("Alert : %25s%10s%5s\n", alerts.list[s_alertIndex].string,
alerts.list[s_alertIndex].action, alerts.list[s_alertIndex].value);
alerts.nalerts = s_alertIndex;
if ((alertFlag > 0) &&
(ecReceivedMsg->message.action == OCMP_AXN_TYPE_REPLY)) {
*alertRecord = 0;
if (alertCount > 0) {
alerts.nalerts = s_alertIndex - 1;
} else {
alerts.nalerts = 0;
}
sem_post(&semCliReturn);
s_alertIndex = 0;
alertFlag = 0;
} else if (alertFlag == 0) {
*alertRecord = 0;
ret = ocmw_handle_show_alerts(response);
if (ret == FAILED)
logdebug("Alert send error\n");
s_alertIndex = 0;
}
free(sMsgFrameParam);
s_alertIndex++;
return;
}
/******************************************************************************
* Function Name : ocmw_parse_command_msgframe
* Description : parse the command
@@ -1048,7 +1280,7 @@ void ocmw_deserialization_msgframe(const Component *subSystem,
int32_t ret = 0;
int8_t index = 0;
if (subSystem == NULL) {
if ((subSystem == NULL) || (ecSendBufBkp == NULL)) {
return;
}

View File

@@ -13,6 +13,7 @@
static OCWareStubsizeflag s_typeFlag;
static OCWareStubDatabase s_ocwareGlobalData[MAX_NUMBER_PARAM];
static OCWareStubPostData s_postGlobalArray[MAX_POST_DEVICE];
static OCWareStubAlertData alertGlobalData[MAX_NUMBER_PARAM];
static int16_t s_defInt16Val = DEFAULT_INT16;
static int64_t s_defInt64Val = DEFAULT_INT64;
@@ -25,6 +26,7 @@ int8_t debugGetCommand = STUB_FAILED;
int8_t debugSetCommand = STUB_FAILED;
int8_t PostResult = STUB_FAILED;
int8_t PostEnable = STUB_FAILED;
int16_t allAlertCount = 0;
extern const Component sys_schema[];
/******************************************************************************
* Function Name : ocware_stub_set_gpioinfo
@@ -179,6 +181,104 @@ ocware_stub_ret ocware_stub_get_post_database(OCMPMessage *msgFrameData,
msgFrameData->parameters = pos/3;
return STUB_SUCCESS;
}
/******************************************************************************
* Function Name : ocware_stub_frame_alert_msgframe
* Description : extract alert data from based on subsystem
*
* @param msgFrameData - output pointer to the OCMPheader field of the message
* from MW (by reference)
* @param payload - output pointer to the payload field of the message from MW
*
* @return STUB_SUCCESS - for success
* STUB_FAILED - for failure
******************************************************************************/
ocware_stub_ret ocware_stub_frame_alert_msgframe(char *buffer)
{
uint32_t ret = 0;
uint32_t subSystemNbr = 0;
uint32_t index = 0;
uint32_t alertIndex = 0;
uint32_t subsystemIndex = 0;
uint8_t printIndex = 0;
uint8_t tempAlertCount = allAlertCount;
OCMPMessageFrame *msgFrame = (OCMPMessageFrame *)buffer;
OCMPMessage *msgFrameData = (OCMPMessage*)&msgFrame->message;
subSystemNbr = msgFrameData->subsystem;
if (subSystemNbr != 0) {
for (subsystemIndex = 0; subsystemIndex < allAlertCount;
subsystemIndex++) {
if (alertGlobalData[subsystemIndex].subsystemId == subSystemNbr)
break;
}
alertIndex = subsystemIndex;
while (alertGlobalData[alertIndex].subsystemId == subSystemNbr)
alertIndex++;
allAlertCount = alertIndex;
}
for (index = subsystemIndex; index < allAlertCount; index++) {
/*create the msgframe*/
ret = ocware_stub_parse_alert_get_message(buffer, index);
printf(" \n Sending Data :\n");
for (printIndex = 0; printIndex < OC_EC_MSG_SIZE; printIndex++) {
printf("0x%x ", buffer[printIndex] & 0xff);
}
ret = ocware_stub_send_msgframe_middleware(&buffer,
sizeof(OCMPMessageFrame));
if (ret != STUB_SUCCESS) {
printf("ocware_stub_send_msgframe_middleware failed: error value :"
"%d\n", ret);
return STUB_FAILED;
}
}
allAlertCount = tempAlertCount;
return STUB_SUCCESS;
}
/******************************************************************************
* Function Name : ocware_stub_get_alert_database
* Description : extract alert data from lookup table
*
* @param msgFrameData - output pointer to the OCMPheader field of the message
* from MW (by reference)
* @param payload - output pointer to the payload field of the message from MW
*
* @return STUB_SUCCESS - for success
* STUB_FAILED - for failure
******************************************************************************/
ocware_stub_ret ocware_stub_get_alert_database(OCMPMessage *msgFrameData,
char *payload, int8_t index)
{
uint8_t pos = 0;
uint8_t defHour = 10;
uint8_t defMinut = 22;
uint8_t defSecond = 15;
uint8_t defDay = 2;
uint8_t defMonth = 7;
uint8_t defYear = 18;
if (index == (allAlertCount - 1)) {
msgFrameData->action = OCMP_AXN_TYPE_REPLY;
} else {
msgFrameData->action = OCMP_AXN_TYPE_ACTIVE;
}
payload[pos + 1] = 2;
strcpy(&payload[pos + 1], (char*)&defHour);
strcpy(&payload[pos + 2], (char*)&defMinut);
strcpy(&payload[pos + 3], (char*)&defSecond);
strcpy(&payload[pos + 4], (char*)&defDay);
strcpy(&payload[pos + 5], (char*)&defMonth);
strcpy(&payload[pos + 6], (char*)&defYear);
strncpy(&payload[pos + 7], (char*)alertGlobalData[index].data,
alertGlobalData[index].paramSize);
strncpy(&payload[pos + 9], (char*)alertGlobalData[index].data,
alertGlobalData[index].paramSize);
msgFrameData->subsystem = alertGlobalData[index].subsystemId;
msgFrameData->componentID = alertGlobalData[index].componentId;
msgFrameData->parameters = alertGlobalData[index].paramId;
return STUB_SUCCESS;
}
/******************************************************************************
* Function Name : ocware_stub_get_gpioinfo
* Description : retrieve the GPIO information in the DB for debug
@@ -749,6 +849,152 @@ ocware_stub_ret ocware_create_command_debug_database(int8_t subsystemNbr,
}
return ret;
}
/******************************************************************************
* Function Name : ocware_stub_fill_alert_value
* Description : Function to fill default alert value in the DB
*
* @param param - pointer to the parameter field in a particular subsytem and
* component (by value)
* gStructIndex - index to the DB (by value)
*
* @return STUB_SUCCESS - for success
* STUB_FAILED - for failure
*****************************************************************************/
ocware_stub_ret ocware_stub_fill_alert_value(const Parameter *param,
uint16_t gStructIndex)
{
const char *paramtype;
if(param == NULL) {
return STUB_FAILED;
}
paramtype = DATA_TYPE_MAP[param->type];
if (!strcmp("uint16",paramtype)) {
strcpy(alertGlobalData[gStructIndex].data, (char *)&s_defInt16Val);
} else if (!strcmp("int16",paramtype)) {
strcpy(alertGlobalData[gStructIndex].data, (char*)&s_defInt16Val);
} else if (!strcmp("uint8",paramtype)) {
strcpy(alertGlobalData[gStructIndex].data, (char*)&s_defInt8Val);
} else if (!strcmp("int8",paramtype)) {
strcpy(alertGlobalData[gStructIndex].data, (char*)&s_defInt8Val);
} else if (!strcmp("string",paramtype)) {
strcpy(alertGlobalData[gStructIndex].data, DEFAULT_STRING);
} else if (!strcmp("enum",paramtype)) {
strcpy(alertGlobalData[gStructIndex].data, (char*)&s_defEnumVal);
} else {
strcpy(alertGlobalData[gStructIndex].data, (char*)&s_defInt8Val);
}
return STUB_SUCCESS;
}
/******************************************************************************
* Function Name : ocware_stub_create_alert_database
* Description : Parse the schema and add alert entries in the DB
*
* @return STUB_SUCCESS - for success
* STUB_FAILED - for failure
******************************************************************************/
ocware_stub_ret ocware_stub_create_alert_database()
{
ocware_stub_ret ret = STUB_FAILED;
int8_t subsystemNbr = 0;
int8_t componentNbr = 0;
const Component *component = NULL;
const Component *subComponent = NULL;
const Component *subSystem = NULL;
const Driver *devDriver = NULL;
const Parameter *param = NULL;
int8_t count = 0;
int8_t alertCount = 0;
int16_t gStructIndex = 0;
int16_t paramPos = 0;
for (subSystem = sys_schema; subSystem && subSystem->name; subSystem++) {
/* Subsystem loop */
componentNbr = 1;
for(component = subSystem->components; component && component->name;
component++) {
/* component loop */
devDriver = component->driver;
if (devDriver != NULL) {
/* This is for componenets w/o any sub component */
count = 0;
paramPos = 0;
param = devDriver->alerts;
/* Alert related parameters */
while (param && param->name) { /*Parameter loop */
alertGlobalData[gStructIndex].subsystemId = subsystemNbr;
alertGlobalData[gStructIndex].componentId = componentNbr;
alertGlobalData[gStructIndex].paramId
= pow(2, count);
alertGlobalData[gStructIndex].paramSize =
ocware_stub_get_paramSize (
DATA_TYPE_MAP[param->type],
OCMP_MSG_TYPE_CONFIG, param->name);
alertGlobalData[gStructIndex].msgtype =
OCMP_MSG_TYPE_CONFIG;
alertGlobalData[gStructIndex].data = malloc(sizeof(char)*
alertGlobalData[gStructIndex].paramSize);
if (alertGlobalData[gStructIndex].data == NULL) {
printf("Malloc failed\n");
return STUB_FAILED;
} else {
memset(alertGlobalData[gStructIndex].data, 0,
alertGlobalData[gStructIndex].paramSize);
}
ocware_stub_fill_alert_value(param, gStructIndex);
paramPos += alertGlobalData[gStructIndex].paramSize;
gStructIndex++;
param += 1;
count = count + 1;
allAlertCount++;
}
}
alertCount = 0;
subComponent = component->components;
while (subComponent && subComponent->name) {
devDriver = subComponent->driver;
if(devDriver == NULL) {
subComponent += 1;
continue;
}
param = devDriver->alerts;
/* Config related parameters */
while (param && param->name) { /*Parameter loop */
alertGlobalData[gStructIndex].subsystemId = subsystemNbr;
alertGlobalData[gStructIndex].componentId = componentNbr;
alertGlobalData[gStructIndex].paramId
= pow(2, alertCount);
alertGlobalData[gStructIndex].paramSize
= ocware_stub_get_paramSize (
DATA_TYPE_MAP[param->type],
OCMP_MSG_TYPE_CONFIG, param->name);
alertGlobalData[gStructIndex].msgtype = OCMP_MSG_TYPE_CONFIG;
alertGlobalData[gStructIndex].data
= malloc(alertGlobalData[gStructIndex].paramSize);
if (alertGlobalData[gStructIndex].data == NULL) {
printf("Malloc failed\n");
return STUB_FAILED;
} else {
memset(alertGlobalData[gStructIndex].data, 0,
alertGlobalData[gStructIndex].paramSize);
}
ocware_stub_fill_alert_value(param, gStructIndex);
gStructIndex++;
param += 1;
alertCount += 1;
allAlertCount++;
}
subComponent += 1;
}
componentNbr++;
}
subsystemNbr++;
}
return ret;
}
/******************************************************************************
* Function Name : ocware_stub_create_post_database
* Description : Parse the schema and add post entries
@@ -1080,6 +1326,7 @@ ocware_stub_ret ocware_stub_init_database()
subsystemNbr++;
}
ret = ocware_stub_create_post_database();
ret = ocware_stub_create_alert_database();
return ret;
}
@@ -1092,7 +1339,8 @@ ocware_stub_ret ocware_stub_init_database()
* @return STUB_SUCCESS - for success
* STUB_FAILED - for failure
******************************************************************************/
ocware_stub_ret ocware_stub_parse_command_message(char *buffer)
ocware_stub_ret ocware_stub_parse_command_message(char *buffer,
uint8_t *alertFlag)
{
OCMPMessageFrame *msgFrame = (OCMPMessageFrame *)buffer;
OCMPMessage *msgFrameData = (OCMPMessage*)&msgFrame->message;
@@ -1112,6 +1360,7 @@ ocware_stub_ret ocware_stub_parse_command_message(char *buffer)
ocware_stub_parse_debug_actiontype(msgFrameData);
ret = ocware_stub_get_set_params(msgFrameData);
}
*alertFlag = ocware_stub_parse_command_from_schema(msgFrameData);
msgFrameData->action = OCMP_AXN_TYPE_REPLY;
return ret;
}

View File

@@ -8,6 +8,7 @@
*/
#include <ocware_stub_main_module.h>
extern int16_t allAlertCount;
/******************************************************************************
* Function Name : ocware_stub_frame_newmsgframe
* Description : Frame the response packet from stub function
@@ -18,7 +19,8 @@
* @return STUB_SUCCESS - for success
* STUB_FAILED - for failure
******************************************************************************/
ocware_stub_ret ocware_stub_frame_newmsgframe(char *buffer, int32_t option)
ocware_stub_ret ocware_stub_frame_newmsgframe(char *buffer, int32_t option,
uint8_t *alertFlag)
{
int32_t ret = 0, index = 0;
OCMPMessageFrame *msgFrame = (OCMPMessageFrame *)buffer;
@@ -34,7 +36,7 @@ ocware_stub_ret ocware_stub_frame_newmsgframe(char *buffer, int32_t option)
switch(msgFrameData->msgtype) {
case OCMP_MSG_TYPE_COMMAND:
ret = ocware_stub_parse_command_message(buffer);
ret = ocware_stub_parse_command_message(buffer, alertFlag);
break;
case OCMP_MSG_TYPE_POST:
@@ -45,7 +47,7 @@ ocware_stub_ret ocware_stub_frame_newmsgframe(char *buffer, int32_t option)
ret = ocware_stub_get_set_params(msgFrameData);
}
if (ret == STUB_SUCCESS) {
if (ret == STUB_SUCCESS && (msgFrameData->msgtype != OCMP_MSG_TYPE_ALERT)) {
/* Setting the action type as REPLY */
msgFrame->message.action = OCMP_AXN_TYPE_REPLY;
printf(" \n Sending Data :\n");
@@ -97,14 +99,14 @@ ocware_stub_ret ocware_stub_validate_msgframe_header(char *buf,
******************************************************************************/
int32_t host_ocstubmain_func(int32_t argc, char *argv[])
{
int32_t rc = 0;
int32_t ret = 0;
char *buffer = NULL;
int32_t loopCount = 0;
char *rootpath = NULL;
uint8_t alertFlag = 0;
OCMPMessageFrame *msgFrame = NULL;
rc = ocware_stub_init_ethernet_comm();
if ( rc != STUB_SUCCESS) {
ret = ocware_stub_init_ethernet_comm();
if ( ret != STUB_SUCCESS) {
printf("\n ERROR: Init Failed - %d", __LINE__);
ocware_stub_deinit_ethernet_comm();
return STUB_FAILED;
@@ -138,11 +140,11 @@ int32_t host_ocstubmain_func(int32_t argc, char *argv[])
while (1) {
memset(buffer, 0, sizeof(OCMPMessageFrame));
rc = ocware_stub_recv_msgfrom_middleware(&buffer,
ret = ocware_stub_recv_msgfrom_middleware(&buffer,
sizeof(OCMPMessageFrame));
if (rc != STUB_SUCCESS) {
if (ret != STUB_SUCCESS) {
printf("ocware_stub_recv_msgfrom_middleware failed: error value :"
" %d\n", rc);
" %d\n", ret);
return STUB_FAILED;
}
@@ -151,26 +153,30 @@ int32_t host_ocstubmain_func(int32_t argc, char *argv[])
for (loopCount = 0; loopCount < OC_EC_MSG_SIZE; loopCount++) {
printf("0x%x ", buffer[loopCount] & 0xff);
}
printf("\n");
//#endif
rc = ocware_stub_validate_msgframe_header(buffer, &msgFrame->message);
if (rc != STUB_SUCCESS) {
ret = ocware_stub_validate_msgframe_header(buffer, &msgFrame->message);
if (ret != STUB_SUCCESS) {
printf("ocware_stub_validate_msgframe_header failed: error value :"
"%d\n", rc);
"%d\n", ret);
return STUB_FAILED;
}
rc = ocware_stub_frame_newmsgframe(buffer, rc);
if (rc != STUB_SUCCESS) {
ret = ocware_stub_frame_newmsgframe(buffer, ret, &alertFlag);
if (ret != STUB_SUCCESS) {
printf("ocware_stub_frame_newmsgframe failed: error value :"
"%d\n", rc);
"%d\n", ret);
return STUB_FAILED;
}
rc = ocware_stub_send_msgframe_middleware(&buffer,
if (alertFlag > 0) {
ret = ocware_stub_frame_alert_msgframe(buffer);
} else {
ret = ocware_stub_send_msgframe_middleware(&buffer,
sizeof(OCMPMessageFrame));
if (rc != STUB_SUCCESS) {
printf("ocware_stub_send_msgframe_middleware failed: error value :"
"%d\n", rc);
return STUB_FAILED;
if (ret != STUB_SUCCESS) {
printf("ocware_stub_send_msgframe_middleware failed: error value :"
"%d\n", ret);
return STUB_FAILED;
}
}
}
free(msgFrame);

View File

@@ -11,6 +11,7 @@
#include <ocmw_occli_comm.h>
#include <ocware_stub_main_module.h>
extern const Component sys_schema[];
/******************************************************************************
* Function Name : ocware_stub_parse_debug_actiontype
* Description : Convert debug actiontype into the SET/GET
@@ -41,6 +42,46 @@ ocware_stub_ret ocware_stub_parse_debug_actiontype(OCMPMessage *msgFrameData)
return ret;
}
/******************************************************************************
* Function Name : ocware_stub_parse_command_from_schema
* Description : Parse the command from schema
*
* @param msgFrameData - output pointer to the OCMPheader field of the message
* from MW (by reference)
*
* @return tempAlertFlag
*******************************************************************************/
uint8_t ocware_stub_parse_command_from_schema(OCMPMessage *msgFrameData)
{
const Component *component = NULL;
const Component *subSystem = NULL;
const Command *command = NULL;
uint8_t subsystemNbr = 0;
uint8_t commandNbr = 0;
uint8_t coponentNbr = 1;
uint8_t tempAlertFlag = 0;
for (subSystem = sys_schema; subSystem && subSystem->name; subSystem++) {
if (subsystemNbr == msgFrameData->subsystem) {
component = subSystem->components;
if (coponentNbr == msgFrameData->componentID) {
command = component->commands;
while (command && command->name) {
if ((strcmp(command->name, "getAlertLogs") == 0) &&
(commandNbr == msgFrameData->action)) {
tempAlertFlag++;
break;
}
commandNbr++;
command++;
}
break;
}
}
subsystemNbr++;
}
return tempAlertFlag;
}
/******************************************************************************
* Function Name : ocware_stub_handle_post_enable
* Description : Process the post enable message
@@ -122,3 +163,30 @@ ocware_stub_ret ocware_stub_parse_post_get_message(char *buffer)
}
return ret;
}
/******************************************************************************
* Function Name : ocware_stub_parse_alert_get_message
* Description : Parse alert messages from MW
*
* @param buffer - output pointer to the message from MW
* index - index for record
*
* @return STUB_SUCCESS - for success
* STUB_FAILED - for failure
******************************************************************************/
ocware_stub_ret ocware_stub_parse_alert_get_message(char *buffer, int8_t index)
{
ocware_stub_ret ret = STUB_FAILED;
OCMPMessageFrame *msgFrame = NULL;
OCMPMessage *msgFrameData = NULL;
char *payload = NULL;
if(buffer == NULL) {
return ret;
}
msgFrame = (OCMPMessageFrame *)buffer;
msgFrameData = (OCMPMessage*)&msgFrame->message;
payload = (char *)&msgFrameData->info;
msgFrameData->action = OCMP_MSG_TYPE_ALERT;
ret = ocware_stub_get_alert_database(msgFrameData, payload, index);
return ret;
}

View File

@@ -0,0 +1,11 @@
Host Build
Git Hash: eb22ea8c5510a8072fc456d20c7e5113db8c5494
Build Host: Linux oc 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
GCC: gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

View File

@@ -0,0 +1,6 @@
bd8d83b75473519480c00496d785a6ec /home/oc/ocware_alert_host/OpenCellular/firmware/host/bin/occli
b649d3c0d905fa2a29e8035a494693cd /home/oc/ocware_alert_host/OpenCellular/firmware/host/bin/ocmw_uart
6e594743ca4e1bc62eb226fdfde34a08 /home/oc/ocware_alert_host/OpenCellular/firmware/host/bin/ocmw_eth
78f9bdfc9a48841fc0fa07e9a83f7367 /home/oc/ocware_alert_host/OpenCellular/firmware/host/bin/ocmw_usb
73c25f6950f665f5217f8d51ceada477 /home/oc/ocware_alert_host/OpenCellular/firmware/host/bin/ocware_stub
6319db78d6f73073e552ea2f509c4761 /home/oc/ocware_alert_host/OpenCellular/firmware/host/bin/ocmw_eth_stub

View File

@@ -0,0 +1,944 @@
[
{
"name": "system",
"driver_cfg": "gbc_spi_flash_memory",
"ssHookSet": {
"postInitFxn": "sys_post_init"
},
"components": [
{
"name": "comp_all",
"driver": "SYSTEMDRV",
"driver_cfg": "gbc_gpp_gpioCfg",
"components": [
{
"name": "eeprom_sid",
"driver": "CAT24C04_gbc_sid",
"driver_cfg": "eeprom_gbc_sid"
},
{
"name": "eeprom_inv",
"driver": "CAT24C04_gbc_inv",
"driver_cfg": "eeprom_gbc_inv"
},
{
"name": "eeprom_mac",
"driver": "Driver_MAC"
},
{
"name": "SPI_flash",
"driver": "FLASHDRV",
"driver_cfg": "gbc_spi_flash_memory"
}
],
"commands": [
{
"name": "reset",
"cb_cmd": "SYS_cmdReset"
},
{
"name": "echo",
"cb_cmd": "SYS_cmdEcho"
},
{
"name": "getAlertLogs",
"cb_cmd": "alert_log"
}
]
}
]
},
{
"name": "power",
"components": [
{
"name": "comp_all",
"components": [
{
"name": "powerSource",
"driver": "PWRSRC",
"driver_cfg": "gbc_pwr_powerSource",
"postDisabled": "POST_DISABLED"
}
],
"commands": [
{
"name": "getAlertLogs",
"cb_cmd": "alert_log"
}
]
},
{
"name": "leadacid_sensor",
"components": [
{
"name": "temp_sensor1",
"driver": "SE98A",
"driver_cfg": "gbc_pwr_lead_acid_ts",
"factory_config": "fact_bc_se98a"
}
]
},
{
"name": "leadacid",
"components": [
{
"name": "battery",
"driver": "LTC4015",
"driver_cfg": "gbc_pwr_ext_bat_charger",
"factory_config": "fact_leadAcid_cfg"
}
]
},
{
"name": "lion",
"components": [
{
"name": "battery",
"driver": "LTC4015",
"driver_cfg": "gbc_pwr_int_bat_charger",
"factory_config": "fact_lithiumIon_cfg"
}
]
},
{
"name": "pse",
"driver": "LTC4274",
"driver_cfg": "gbc_pwr_pse",
"factory_config": "fact_ltc4274_cfg"
},
{
"name": "pd",
"driver": "LTC4275",
"driver_cfg": "gbc_pwr_pd"
}
]
},
{
"name": "bms",
"components": [
{
"name": "comp_all",
"postDisabled": "POST_DISABLED",
"commands": [
{
"name": "getAlertLogs",
"cb_cmd": "alert_log"
}
]
},
{
"name": "ec",
"components": [
{
"name": "temp_sensor1",
"driver": "SE98A",
"driver_cfg": "gbc_bms_ec_ts",
"factory_config": "fact_ec_se98a_cfg"
},
{
"name": "current_sensor1",
"driver": "INA226",
"driver_cfg": "gbc_bms_ec_ps_12v",
"factory_config": "fact_ec_12v_ps_cfg"
},
{
"name": "current_sensor2",
"driver": "INA226",
"driver_cfg": "gbc_bms_ec_ps_3p3v",
"factory_config": "fact_ec_3v_ps_cfg"
}
]
}
]
},
{
"name": "hci",
"ssHookSet": {
"preInitFxn": "HCI_Init",
"postInitFxn": "NULL"
},
"components": [
{
"name": "comp_all",
"postDisabled": "POST_DISABLED",
"commands": [
{
"name": "getAlertLogs",
"cb_cmd": "alert_log"
}
]
},
{
"name": "led",
"components": [
{
"name": "temp_sensor1",
"driver": "SE98A",
"driver_cfg": "led_hci_ts",
"factory_config": "fact_led_se98a_cfg",
"postDisabled": "POST_DISABLED"
},
{
"name": "fw",
"driver": "HCI_LED",
"driver_cfg": "led_hci_ioexp"
}
]
},
{
"name": "buzzer",
"driver_cfg": "gbc_hci_buzzer",
"postDisabled": "POST_DISABLED"
}
]
},
{
"name": "ethernet",
"components": [
{
"name": "comp_all",
"postDisabled": "POST_DISABLED",
"commands": [
{
"name": "getAlertLogs",
"cb_cmd": "alert_log"
}
]
},
{
"name": "port0",
"driver": "ETH_SW",
"driver_cfg": "gbc_eth_port0"
},
{
"name": "port1",
"driver": "ETH_SW",
"driver_cfg": "gbc_eth_port1"
},
{
"name": "port2",
"driver": "ETH_SW",
"driver_cfg": "gbc_eth_port2"
},
{
"name": "port3",
"driver": "ETH_SW",
"driver_cfg": "gbc_eth_port3"
},
{
"name": "port4",
"driver": "ETH_SW",
"driver_cfg": "gbc_eth_port4"
}
]
},
{
"name": "obc",
"ssHookSet": {
"preInitFxn": "obc_pre_init",
"postInitFxn": "NULL"
},
"driver_cfg": "sync_obc_gpiocfg",
"components": [
{
"name": "comp_all",
"postDisabled": "POST_DISABLED"
},
{
"name": "iridium",
"driver": "OBC_Iridium",
"driver_cfg": "obc_irridium"
}
]
},
{
"name": "gpp",
"components": [
{
"name": "comp_all",
"postDisabled": "POST_DISABLED",
"commands": [
{
"name": "getAlertLogs",
"cb_cmd": "alert_log"
}
]
},
{
"name": "ap",
"components": [
{
"name": "temp_sensor1",
"driver": "SE98A",
"driver_cfg": "gbc_gpp_ap_ts1",
"factory_config": "fact_ap_se98a_ts1_cfg"
},
{
"name": "temp_sensor2",
"driver": "SE98A",
"driver_cfg": "gbc_gpp_ap_ts2",
"factory_config": "fact_ap_se98a_ts2_cfg"
},
{
"name": "temp_sensor3",
"driver": "SE98A",
"driver_cfg": "gbc_gpp_ap_ts3",
"factory_config": "fact_ap_se98a_ts3_cfg"
},
{
"name": "current_sensor1",
"driver": "INA226",
"driver_cfg": "gbc_gpp_ap_ps",
"factory_config": "fact_ap_3v_ps_cfg"
}
],
"driver_cfg": "gbc_gpp_gpioCfg",
"commands": [
{
"name": "reset",
"cb_cmd": "GPP_ap_Reset"
},
{
"name": "getAlertLogs",
"cb_cmd": "alert_log"
}
]
},
{
"name": "msata",
"components": [
{
"name": "current_sensor1",
"driver": "INA226",
"driver_cfg": "gbc_gpp_msata_ps",
"factory_config": "fact_msata_3v_ps_cfg"
}
]
}
],
"driver_cfg": "gbc_gpp_gpioCfg",
"ssHookSet": {
"preInitFxn": "gpp_pre_init",
"postInitFxn": "gpp_post_init"
}
},
{
"name": "sdr",
"components": [
{
"name": "comp_all",
"components": [
{
"name": "current_sensor1",
"driver": "INA226",
"driver_cfg": "sdr_ps",
"factory_config": "fact_sdr_3v_ps_cfg"
},
{
"name": "eeprom",
"driver_cfg": "eeprom_sdr_inv",
"driver": "CAT24C04_sdr_inv"
}
],
"driver_cfg": "sdr_gpioCfg",
"commands": [
{
"name": "reset",
"cb_cmd": "SDR_reset"
},
{
"name": "getAlertLogs",
"cb_cmd": "alert_log"
}
]
},
{
"name": "fpga",
"components": [
{
"name": "temp_sensor1",
"driver": "ADT7481",
"driver_cfg": "sdr_fpga_ts",
"factory_config": "fact_sdr_fpga_adt7481_cfg"
},
{
"name": "current_sensor1",
"driver": "INA226",
"driver_cfg": "sdr_fpga_ps",
"factory_config": "fact_sdr_fpga_ps_cfg"
}
]
},
{
"name": "fx3",
"driver_cfg": "sdr_gpioCfg",
"commands": [
{
"name": "reset",
"cb_cmd": "SDR_fx3Reset"
}
],
"postDisabled": "POST_DISABLED"
}
],
"driver_cfg": "sdr_gpioCfg",
"ssHookSet": {
"preInitFxn": "SDR_Init",
"postInitFxn": "NULL"
}
},
{
"name": "rffe",
"driver_cfg": "fe_rffecfg",
"components": [
{
"name": "comp_all",
"components": [
{
"name": "eeprom",
"driver": "CAT24C04_fe_inv",
"driver_cfg": "eeprom_fe_inv"
}
],
"driver_cfg": "sdr_gpioCfg",
"commands": [
{
"name": "reset",
"cb_cmd": "RFFE_reset"
},
{
"name": "getAlertLogs",
"cb_cmd": "alert_log"
}
]
},
{
"name": "ch1_sensor",
"components": [
{
"name": "temp_sensor1",
"driver": "ADT7481",
"driver_cfg": "fe_ch1_ts",
"factory_config": "fact_fe_ch1_adt7481_cfg"
},
{
"name": "current_sensor1",
"driver": "INA226",
"driver_cfg": "fe_ch1_ps_5_7v",
"factory_config": "fact_fe_ch1_ps_cfg"
}
]
},
{
"name": "ch2_sensor",
"components": [
{
"name": "temp_sensor1",
"driver": "ADT7481",
"driver_cfg": "fe_ch2_ts",
"factory_config": "fact_fe_ch2_adt7481_cfg"
},
{
"name": "current_sensor1",
"driver": "INA226",
"driver_cfg": "fe_ch2_ps_5_7v",
"factory_config": "fact_fe_ch2_ps_cfg"
}
]
},
{
"name": "ch1_fe",
"driver_cfg": "fe_ch1_pwrcfg",
"components": [
{
"name": "ch1_band",
"driver": "FE_Param",
"driver_cfg": "fe_ch1_bandcfg",
"factory_config": "fact_ch1_band_cfg"
},
{
"name": "watchdog",
"driver": "RFFEWatchdog",
"driver_cfg": "fe_ch1_watchdog"
},
{
"name": "power",
"driver": "RFPowerMonitor",
"driver_cfg": "fe_ch1_ads7830"
},
{
"name": "tx",
"driver": "DATXXR5APP",
"driver_cfg": "fe_ch1_gain",
"factory_config": "fact_ch1_tx_gain_cfg"
},
{
"name": "rx",
"driver": "DATXXR5APP",
"driver_cfg": "fe_ch1_lna",
"factory_config": "fact_ch1_rx_gain_cfg"
}
],
"commands": [
{
"name": "enable",
"cb_cmd": "RFFE_enablePA"
},
{
"name": "disable",
"cb_cmd": "RFFE_disablePA"
}
]
},
{
"name": "ch2_fe",
"driver_cfg": "fe_ch2_pwrcfg",
"components": [
{
"name": "ch2_band",
"driver": "FE_Param",
"driver_cfg": "fe_ch2_bandcfg",
"factory_config": "fact_ch2_band_cfg"
},
{
"name": "watchdog",
"driver": "RFFEWatchdog",
"driver_cfg": "fe_ch2_watchdog"
},
{
"name": "power",
"driver": "RFPowerMonitor",
"driver_cfg": "fe_ch2_ads7830"
},
{
"name": "tx",
"driver": "DATXXR5APP",
"driver_cfg": "fe_ch2_gain",
"factory_config": "fact_ch2_tx_gain_cfg"
},
{
"name": "rx",
"driver": "DATXXR5APP",
"driver_cfg": "fe_ch2_lna",
"factory_config": "fact_ch2_rx_gain_cfg"
}
],
"commands": [
{
"name": "enable",
"cb_cmd": "RFFE_enablePA"
},
{
"name": "disable",
"cb_cmd": "RFFE_disablePA"
}
]
}
],
"ssHookSet": {
"preInitFxn": "rffe_pre_init",
"postInitFxn": "rffe_post_init"
}
},
{
"name": "sync",
"driver_cfg": "sync_gpiocfg",
"ssHookSet": {
"preInitFxn": "SYNC_Init",
"postInitFxn": "NULL"
},
"components": [
{
"name": "comp_all",
"driver_cfg": "sync_gpiocfg",
"commands": [
{
"name": "reset",
"cb_cmd": "SYNC_reset"
},
{
"name": "getAlertLogs",
"cb_cmd": "alert_log"
}
],
"postDisabled": "POST_DISABLED"
},
{
"name": "gps",
"driver_cfg": "sync_gpiocfg",
"driver": "Sync_IO"
},
{
"name": "sensor",
"components": [
{
"name": "temp_sensor1",
"driver": "ADT7481",
"driver_cfg": "sync_gps_ts",
"factory_config": "fact_sync_ts_cfg"
}
]
}
]
},
{
"name": "testmodule",
"components": [
{
"name": "comp_all",
"commands": [
{
"name": "reset",
"cb_cmd": "TestMod_cmdReset"
}
],
"postDisabled": "POST_DISABLED"
},
{
"name": "2gsim",
"driver": "Testmod_G510",
"driver_cfg": "testModuleCfg"
}
]
},
{
"name": "debug",
"components": [
{
"name": "comp_all",
"postDisabled": "POST_DISABLED"
},
{
"name": "I2C",
"components": [
{
"name": "comp_all",
"postDisabled": "POST_DISABLED"
},
{
"name": "bus0",
"driver": "OC_I2C",
"driver_cfg": "debug_I2C0",
"postDisabled": "POST_DISABLED"
},
{
"name": "bus1",
"driver": "OC_I2C",
"driver_cfg": "debug_I2C1",
"postDisabled": "POST_DISABLED"
},
{
"name": "bus2",
"driver": "OC_I2C",
"driver_cfg": "debug_I2C2",
"postDisabled": "POST_DISABLED"
},
{
"name": "bus3",
"driver": "OC_I2C",
"driver_cfg": "debug_I2C3",
"postDisabled": "POST_DISABLED"
},
{
"name": "bus4",
"driver": "OC_I2C",
"driver_cfg": "debug_I2C4",
"postDisabled": "POST_DISABLED"
},
{
"name": "bus6",
"driver": "OC_I2C",
"driver_cfg": "debug_I2C6",
"postDisabled": "POST_DISABLED"
},
{
"name": "bus7",
"driver": "OC_I2C",
"driver_cfg": "debug_I2C7",
"postDisabled": "POST_DISABLED"
},
{
"name": "bus8",
"driver": "OC_I2C",
"driver_cfg": "debug_I2C8",
"postDisabled": "POST_DISABLED"
}
]
},
{
"name": "ec",
"components": [
{
"name": "comp_all",
"postDisabled": "POST_DISABLED"
},
{
"name": "PA",
"driver": "OC_GPIO",
"driver_cfg": "debug_ec_gpio_pa",
"postDisabled": "POST_DISABLED"
},
{
"name": "PB",
"driver": "OC_GPIO",
"driver_cfg": "debug_ec_gpio_pb",
"postDisabled": "POST_DISABLED"
},
{
"name": "PC",
"driver": "OC_GPIO",
"driver_cfg": "debug_ec_gpio_pc",
"postDisabled": "POST_DISABLED"
},
{
"name": "PD",
"driver": "OC_GPIO",
"driver_cfg": "debug_ec_gpio_pd",
"postDisabled": "POST_DISABLED"
},
{
"name": "PE",
"driver": "OC_GPIO",
"driver_cfg": "debug_ec_gpio_pe",
"postDisabled": "POST_DISABLED"
},
{
"name": "PF",
"driver": "OC_GPIO",
"driver_cfg": "debug_ec_gpio_pf",
"postDisabled": "POST_DISABLED"
},
{
"name": "PG",
"driver": "OC_GPIO",
"driver_cfg": "debug_ec_gpio_pg",
"postDisabled": "POST_DISABLED"
},
{
"name": "PH",
"driver": "OC_GPIO",
"driver_cfg": "debug_ec_gpio_ph",
"postDisabled": "POST_DISABLED"
},
{
"name": "PJ",
"driver": "OC_GPIO",
"driver_cfg": "debug_ec_gpio_pj",
"postDisabled": "POST_DISABLED"
},
{
"name": "PK",
"driver": "OC_GPIO",
"driver_cfg": "debug_ec_gpio_pk",
"postDisabled": "POST_DISABLED"
},
{
"name": "PL",
"driver": "OC_GPIO",
"driver_cfg": "debug_ec_gpio_pl",
"postDisabled": "POST_DISABLED"
},
{
"name": "PM",
"driver": "OC_GPIO",
"driver_cfg": "debug_ec_gpio_pm",
"postDisabled": "POST_DISABLED"
},
{
"name": "PN",
"driver": "OC_GPIO",
"driver_cfg": "debug_ec_gpio_pn",
"postDisabled": "POST_DISABLED"
},
{
"name": "PP",
"driver": "OC_GPIO",
"driver_cfg": "debug_ec_gpio_pn",
"postDisabled": "POST_DISABLED"
},
{
"name": "PQ",
"driver": "OC_GPIO",
"driver_cfg": "debug_ec_gpio_pq",
"postDisabled": "POST_DISABLED"
}
]
},
{
"name": "gbc",
"components": [
{
"name": "comp_all",
"postDisabled": "POST_DISABLED"
},
{
"name": "ioexpanderx70",
"driver": "OC_GPIO",
"driver_cfg": "debug_gbc_ioexpanderx70"
},
{
"name": "ioexpanderx71",
"driver": "OC_GPIO",
"driver_cfg": "debug_gbc_ioexpanderx71"
}
]
},
{
"name": "sdr",
"components": [
{
"name": "comp_all",
"postDisabled": "POST_DISABLED"
},
{
"name": "ioexpanderx1E",
"driver": "OC_GPIO",
"driver_cfg": "debug_sdr_ioexpanderx1E"
}
]
},
{
"name": "fe",
"components": [
{
"name": "comp_all",
"postDisabled": "POST_DISABLED"
},
{
"name": "ioexpanderx18",
"driver": "OC_GPIO",
"driver_cfg": "debug_sdr_ioexpanderx1E"
},
{
"name": "ioexpanderx1C",
"driver": "OC_GPIO",
"driver_cfg": "debug_fe_ioexpanderx1C"
},
{
"name": "ioexpanderx1B",
"driver": "OC_GPIO",
"driver_cfg": "debug_fe_ioexpanderx1B"
},
{
"name": "ioexpanderx1A",
"driver": "OC_GPIO",
"driver_cfg": "debug_fe_ioexpanderx1A"
},
{
"name": "ioexpanderx1D",
"driver": "OC_GPIO",
"driver_cfg": "debug_fe_ioexpanderx1D"
}
]
},
{
"name": "sync",
"components": [
{
"name": "comp_all",
"postDisabled": "POST_DISABLED"
},
{
"name": "ioexpanderx71",
"driver": "OC_GPIO",
"driver_cfg": "debug_sync_ioexpanderx71"
}
]
},
{
"name": "ethernet",
"components": [
{
"name": "comp_all",
"postDisabled": "POST_DISABLED"
},
{
"name": "port0",
"driver": "OC_MDIO",
"driver_cfg": "debug_mdio_phyport0",
"postDisabled": "POST_DISABLED"
},
{
"name": "port1",
"driver": "OC_MDIO",
"driver_cfg": "debug_mdio_phyport1",
"postDisabled": "POST_DISABLED"
},
{
"name": "port2",
"driver": "OC_MDIO",
"driver_cfg": "debug_mdio_phyport2",
"postDisabled": "POST_DISABLED"
},
{
"name": "port3",
"driver": "OC_MDIO",
"driver_cfg": "debug_mdio_phyport3",
"postDisabled": "POST_DISABLED"
},
{
"name": "port4",
"driver": "OC_MDIO",
"driver_cfg": "debug_mdio_phyport4",
"postDisabled": "POST_DISABLED"
},
{
"name": "global1",
"driver": "OC_MDIO",
"driver_cfg": "debug_mdio_global1",
"postDisabled": "POST_DISABLED"
},
{
"name": "global2",
"driver": "OC_MDIO",
"driver_cfg": "debug_mdio_global2",
"postDisabled": "POST_DISABLED"
},
{
"name": "swport0",
"driver": "OC_MDIO",
"driver_cfg": "debug_mdio_swport0",
"postDisabled": "POST_DISABLED"
},
{
"name": "swport1",
"driver": "OC_MDIO",
"driver_cfg": "debug_mdio_swport1",
"postDisabled": "POST_DISABLED"
},
{
"name": "swport2",
"driver": "OC_MDIO",
"driver_cfg": "debug_mdio_swport2",
"postDisabled": "POST_DISABLED"
},
{
"name": "swport3",
"driver": "OC_MDIO",
"driver_cfg": "debug_mdio_swport3",
"postDisabled": "POST_DISABLED"
},
{
"name": "swport4",
"driver": "OC_MDIO",
"driver_cfg": "debug_mdio_swport4",
"postDisabled": "POST_DISABLED"
},
{
"name": "swport5",
"driver": "OC_MDIO",
"driver_cfg": "debug_mdio_swport5",
"postDisabled": "POST_DISABLED"
},
{
"name": "swport6",
"driver": "OC_MDIO",
"driver_cfg": "debug_mdio_swport6",
"postDisabled": "POST_DISABLED"
}
]
}
]
}
]