static void SendNotification(AJ_BusAttachment* busAttachment) { uint16_t messageType = AJNS_NOTIFICATION_MESSAGE_TYPE_INFO; uint32_t ttl = AJNS_NOTIFICATION_TTL_MIN; // Note needs to be in the range AJNS_NOTIFICATION_TTL_MIN..AJNS_NOTIFICATION_TTL_MAX uint32_t serialNum; AJNS_Producer_SendNotification(busAttachment, ¬ificationContent, messageType, ttl, &serialNum); }
/** * Meant to simulate scenario where sometimes Notifications are set when * Send Notification is called and sometimes not. */ void NotificationProducer_DoWork(AJ_BusAttachment* busAttachment) { if (isThereANotificationToSend() > 0) { notificationContent.numTexts = NUM_TEXTS; textToSend[0].key = langEng; textToSend[0].value = getNotificationString(); AJ_AlwaysPrintf(("About to send Notification ==> %s \n", textToSend[0].value)); AJNS_Producer_SendNotification(busAttachment, ¬ificationContent, AJNS_NOTIFICATION_MESSAGE_TYPE_INFO, 20000, NULL); } }
void SendNotification(uint16_t messageType, char * lang, char * msg) { // uint16_t messageType = AJNS_NOTIFICATION_MESSAGE_TYPE_INFO; uint32_t ttl = AJNS_NOTIFICATION_TTL_MIN; // Note needs to be in the range AJNS_NOTIFICATION_TTL_MIN..AJNS_NOTIFICATION_TTL_MAX uint32_t serialNum; notificationContent.numTexts = NUM_TEXTS; textToSend[0].key = lang; textToSend[0].value = msg; notificationContent.texts = textToSend; AJNS_Producer_SendNotification(&c_bus, ¬ificationContent, messageType, ttl, &serialNum); }