Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions agent/ingest.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,13 @@ void *rx_thread(int *running) {
}
break;

case MSG_TYPE_CTRL_PERIOD_PROD:
{
AMP_DEBUG_ALWAYS("NM Agent :","Received Periodic Production Ctrl Message.\n", NULL);
rx_handle_time_prod(&meta, cursor, size, &bytes);
}
break;

default:
{
AMP_DEBUG_WARN("rx_thread","Received unknown type: %d.\n", hdr->type);
Expand Down
33 changes: 20 additions & 13 deletions mgr/nm_mgr_netui.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ void netui_construct_ctrl_by_idx(agent_t* agent,cmdFormat* curCmd)

void netui_construct_time_rule_by_idx(agent_t* agent,cmdFormat* curCmd)
{
mid_t* id = NULL;
time_t offset = 0;
uint32_t period = 0;
uint32_t evals = 0;
Expand All @@ -224,20 +225,30 @@ void netui_construct_time_rule_by_idx(agent_t* agent,cmdFormat* curCmd)
/* Step 1a: "tokenize" the string */

char** args=netui_parse_arguments(curCmd->arguments,&numArgs);
if(numArgs<4)
if(numArgs<5)
{
AMP_DEBUG_ERR("netui_construct_time_rule_by_idx","Not enough arguments %d",numArgs);
return;
}

offset=atoi(args[0]);
period=atoi(args[1]);
evals=atoi(args[2]);
oid_t oid_id = oid_construct(OID_TYPE_FULL, NULL, 0, args[0], strlen(args[0]));
printf("Parsed OID: %s\n", oid_pretty_print(oid_id));

/* Step 1b: Split the MID array */
unsigned int x = 3;
id = mid_construct(MID_TRL, NULL, NULL, oid_id);

if (id == NULL) {
AMP_DEBUG_ERR("netui_construct_time_rule_by_idx","Could not create MID",NULL);
return;
}

//printf("Parsed MID: %s\n", mid_pretty_print(id));

for(x=3;x<numArgs;x++)
offset=atoi(args[1]);
period=atoi(args[2]);
evals=atoi(args[3]);

/* Step 1b: Split the MID array */
for(unsigned int x = 4; x < numArgs; x++)
{
AMP_DEBUG_INFO("netui_construct_time_rule_by_idx","Found argument %s",args[x]);
//Fill into temp command
Expand Down Expand Up @@ -273,15 +284,10 @@ void netui_construct_time_rule_by_idx(agent_t* agent,cmdFormat* curCmd)
//Insert into lyst

netui_parse_single_mid_str(mids, mid_str,arguments,lyst_length(gAdmData)-1, MID_ATOMIC);


//mids = netui_parse_mid_str(curCmd,midIdxC, lyst_length(gAdmData))-1, MID_TYPE_DATA)
}

/* mids = netui_parse_mid_str(curCmd,midIdxC, lyst_length(gAdmData))-1, MID_TYPE_DATA);

/* Step 2: Construct the control primitive. */
trl_t *entry = trl_create(NULL, offset, evals, period, mids); // XXX: Place some MID ID here
trl_t *entry = trl_create(id, offset, evals, period, mids);

/* Step 3: Construct a PDU to hold the primitive. */
uint8_t *data = trl_serialize(entry, &size);
Expand All @@ -295,6 +301,7 @@ void netui_construct_time_rule_by_idx(agent_t* agent,cmdFormat* curCmd)
pdu_release_group(pdu_group);
trl_release(entry);
midcol_destroy(&mids);
mid_release(id);

SRELEASE(args);

Expand Down
4 changes: 2 additions & 2 deletions mgr/nm_mgr_netui.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ void ui_deregister_agent();

void ui_event_loop(int *running);

mid_t *ui_input_mid();
int ui_input_mid_flag(uint8_t *flag);
//mid_t *ui_input_mid();
//int ui_input_mid_flag(uint8_t *flag);

Lyst ui_parse_mid_str(char *mid_str, int max_idx, int type);

Expand Down