本文整理汇总了C++中AJ_AlwaysPrintf函数的典型用法代码示例。如果您正苦于以下问题:C++ AJ_AlwaysPrintf函数的具体用法?C++ AJ_AlwaysPrintf怎么用?C++ AJ_AlwaysPrintf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AJ_AlwaysPrintf函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AJRouter_Connect
uint8_t AJRouter_Connect(AJ_BusAttachment* busAttachment, const char* routerName)
{
while (TRUE) {
AJ_Status status = AJ_OK;
#ifdef ONBOARDING_SERVICE
status = AJOBS_EstablishWiFi();
if (status != AJ_OK) {
AJ_AlwaysPrintf(("Failed to establish WiFi connectivity with status=%s\n", AJ_StatusText(status)));
AJ_Sleep(AJAPP_CONNECT_PAUSE);
return FALSE;
}
#endif
AJ_AlwaysPrintf(("Attempting to connect to bus '%s'\n", routerName));
status = AJ_FindBusAndConnect(busAttachment, routerName, AJAPP_CONNECT_TIMEOUT);
if (status != AJ_OK) {
AJ_AlwaysPrintf(("Failed to connect to bus sleeping for %d seconds\n", AJAPP_CONNECT_PAUSE / 1000));
AJ_Sleep(AJAPP_CONNECT_PAUSE);
#ifdef ONBOARDING_SERVICE
if (status == AJ_ERR_DHCP) {
AJOBS_SwitchToRetry();
}
#endif
continue;
}
const char* busUniqueName = AJ_GetUniqueName(busAttachment);
if (busUniqueName == NULL) {
AJ_AlwaysPrintf(("Failed to GetUniqueName() from newly connected bus, retrying\n"));
continue;
}
AJ_AlwaysPrintf(("Connected to router with BusUniqueName=%s\n", busUniqueName));
break;
}
return TRUE;
}
示例2: PasswordCallback
static uint32_t PasswordCallback(uint8_t* buffer, uint32_t bufLen)
{
AJ_Status status = AJ_OK;
#ifdef CONFIG_SERVICE
const char* hexPassword = AJSVC_PropertyStore_GetValue(AJSVC_PROPERTY_STORE_PASSCODE);
#else
const char* hexPassword = "303030303030";
#endif
size_t hexPasswordLen;
uint32_t len = 0;
if (hexPassword == NULL) {
AJ_AlwaysPrintf(("Password is NULL!\n"));
return len;
}
AJ_AlwaysPrintf(("Configured password=%s\n", hexPassword));
hexPasswordLen = strlen(hexPassword);
len = hexPasswordLen / 2;
status = AJ_HexToRaw(hexPassword, hexPasswordLen, buffer, bufLen);
if (status == AJ_ERR_RESOURCES) {
len = 0;
}
return len;
}
示例3: SendEvent
static AJ_Status SendEvent(AJ_BusAttachment* busAttachment, uint32_t eventId)
{
AJ_Status status = AJ_OK;
AJ_Message msg;
status = AJ_MarshalSignal(busAttachment, &msg, eventId, NULL, 0, AJ_FLAG_SESSIONLESS, 0);
if (status != AJ_OK) {
goto ErrorExit;
}
status = AJ_DeliverMsg(&msg);
if (status != AJ_OK) {
goto ErrorExit;
}
status = AJ_CloseMsg(&msg);
if (status != AJ_OK) {
goto ErrorExit;
}
AJ_AlwaysPrintf(("Event sent successfully\n"));
return status;
ErrorExit:
AJ_AlwaysPrintf(("Event sending failed with status=%s\n", AJ_StatusText(status)));
return status;
}
示例4: AppHandlePing
static AJ_Status AppHandlePing(AJ_Message* msg)
{
AJ_Status status;
AJ_Message reply;
AJ_Arg arg;
status = AJ_UnmarshalArg(msg, &arg);
if (AJ_OK == status) {
if (arg.typeId == AJ_ARG_STRING) {
AJ_AlwaysPrintf(("Received ping request '%s'.\n", arg.val.v_string));
} else {
AJ_AlwaysPrintf(("Unexpected arg type '%d' in ping request.\n", arg.typeId));
}
status = AJ_MarshalReplyMsg(msg, &reply);
if (AJ_OK == status) {
/*
* Just return the arg we received
*/
status = AJ_MarshalArg(&reply, &arg);
if (AJ_OK == status) {
status = AJ_DeliverMsg(&reply);
}
}
}
return status;
}
示例5: AJ_WSL_HTCProcessControlMessageResponse_Fake
static void AJ_WSL_HTCProcessControlMessageResponse_Fake(AJ_BufNode* pNodeHTCBody)
{
wsl_wmi_cmd_hdr* wmiCmdHdr2;
wmiCmdHdr2 = (wsl_wmi_cmd_hdr*)pNodeHTCBody->buffer;
AJ_WSL_WMI_CMD_HDR_FROM_WIRE(wmiCmdHdr2);
AJ_WSL_WMI_CMD_HDR_Print(wmiCmdHdr2);
AJ_BufNodePullBytes(pNodeHTCBody, sizeof(wsl_wmi_cmd_hdr));
if (wmiCmdHdr2->commandID == WMI_SOCKET_CMDID) {
wsl_wmi_socket_response_event* pSocketResp = (wsl_wmi_socket_response_event*)pNodeHTCBody->buffer;
AJ_WSL_WMI_SOCK_RESPONSE_FROM_WIRE(pSocketResp);
switch (pSocketResp->responseType) {
case WSL_SOCK_OPEN: {
//AJ_AlwaysPrintf(("PING response was received over the wire: addr 0x%x, size 0x%x\n\n", ping->ip_addr, ping->size));
AJ_AlwaysPrintf(("OPEN response was received over the wire, Handle is %x\n\n", pSocketResp->socketHandle));
break;
}
case WSL_SOCK_PING: {
//wsl_wmi_sock_ping* ping = (wsl_wmi_sock_ping*)pNodeHTCBody->buffer;
//AJ_WSL_WMI_SOCK_PING_FROM_WIRE(ping);
//AJ_AlwaysPrintf(("PING response was received over the wire: addr 0x%x, size 0x%x\n\n", ping->ip_addr, ping->size));
AJ_AlwaysPrintf(("PING response was received over the wire, Handle is %x\n\n", pSocketResp->socketHandle));
break;
}
default:
AJ_ASSERT("unknown socket command\n\n");
}
}
}
示例6: handleOptionalProperty
static void handleOptionalProperty(const char* peerName, const char* key, const char* sig, const AJ_Arg* value) {
if (strcmp(sig, "s") == 0) {
AJ_AlwaysPrintf(("Optional Prop: %s=\"%s\"\n", key, value->val.v_string));
} else {
AJ_AlwaysPrintf(("Optional Prop: %s=[Not A String]\n", key));
}
}
示例7: AllJoyn_Start
void AllJoyn_Start() {
AJ_Status status = AJ_OK;
AJ_AlwaysPrintf(("AllJoyn Version %s\n", AJ_GetVersion()));
// status = AJ_WiFiScan(NULL, ScanResult, 32);
// if (status != AJ_OK) {
// AJ_AlwaysPrintf(("WiFi scan failed\n"));
// }
// status = ConfigureSoftAP();
esp_init(115200);
status = ConfigureWifi();
// esp_serial_proxy();
if (status == AJ_OK) {
// AJ_Initialize();
AJ_Main();
}
AJ_AlwaysPrintf(("Quitting\n"));
while (TRUE) {
}
}
示例8: PasswordCallback
/**
* Callback function prototype for requesting a password or pincode from an application.
*
* @param buffer The buffer to receive the password.
* @param bufLen The size of the buffer
*
* @return Returns the length of the password. If the length is zero this will be
* treated as a rejected password request.
*/
static uint32_t PasswordCallback(uint8_t* buffer, uint32_t bufLen)
{
char inputBuffer[16];
const uint32_t bufSize = sizeof(inputBuffer) / sizeof(inputBuffer[0]);
uint32_t maxCopyLength;
#ifdef AJ_NO_CONSOLE /* If there is no console to read/write from/to. */
const char password[] = "107734"; /* Upside down this can be read as 'hELLO!'. */
maxCopyLength = sizeof(password) - 1;
if (maxCopyLength > bufSize) {
maxCopyLength = bufSize;
}
memcpy(inputBuffer, password, maxCopyLength);
#else
/* Take input from stdin and send it. */
AJ_AlwaysPrintf(("Please enter one time password : "));
/* Use 'bufSize - 1' to allow for '\0' termination. */
maxCopyLength = get_line(inputBuffer, bufSize - 1, stdin);
#endif
if (maxCopyLength > bufLen) {
maxCopyLength = bufLen;
}
/* Always terminated with a '\0' for following AJ_Printf(). */
inputBuffer[maxCopyLength] = '\0';
memcpy(buffer, inputBuffer, maxCopyLength);
AJ_AlwaysPrintf(("Responding with password of '%s' length %u.\n", inputBuffer, maxCopyLength));
return maxCopyLength;
}
示例9: ReceiveNewName
AJ_Status ReceiveNewName(AJ_Message*msg)
{
AJ_Arg arg;
AJ_Status status = AJ_UnmarshalArg(msg, &arg);
if (status == AJ_OK) {
AJ_AlwaysPrintf(("--==## signalConsumer: Name Changed signal Received ##==--\n"));
AJ_AlwaysPrintf(("\tNew name: '%s'.\n", arg.val.v_string));
}
return status;
}
示例10: TimerCallbackEndProc
void TimerCallbackEndProc(uint32_t timerId, void* context)
{
AJ_AlwaysPrintf(("TimerCallbackEndProc %.6d \n", timerId));
#ifdef READTEST
if (0 == memcmp(txBuffer, rxBuffer, sizeof(rxBuffer))) {
AJ_AlwaysPrintf(("Passed: buffers match.\n"));
} else {
AJ_AlwaysPrintf(("FAILED: buffers mismatch.\n"));
exit(-1);
}
#endif
exit(0);
}
示例11: ApplicationHandleDismiss
static AJ_Status ApplicationHandleDismiss(int32_t notificationId, const char* appId)
{
AJ_AlwaysPrintf(("******************** Begin New Dismiss Received ********************\n"));
AJ_AlwaysPrintf(("Notification Id: %d\nApp Id: %s\n", notificationId, appId));
if (savedNotification.version > 0 && !strcmp(appId, savedNotification.appId) && notificationId == savedNotification.notificationId) {
AJ_AlwaysPrintf(("Notification dimissed: Version %u sent from OriginalSender %s\n", savedNotification.version, savedNotification.originalSenderName));
if (processingAction == FALSE) {
savedNotification.version = 0;
}
}
AJ_AlwaysPrintf(("******************** End New Dismiss Received ********************\n"));
return AJ_OK;
}
示例12: NotificationConsumer_Init
AJ_Status NotificationConsumer_Init()
{
AJ_Status status = AJ_OK;
Consumer_SetupEnv(&inputMode, &superAgentMode);
AJ_AlwaysPrintf(("Init(): Set Consumer to detect SuperAgent option is turned %s\n", superAgentMode ? "ON" : "off"));
status = AJNS_Consumer_Start(superAgentMode, &ApplicationHandleNotify, &ApplicationHandleDismiss);
memset(&savedNotification, 0, sizeof(AJNS_Consumer_NotificationReference));
AJ_AlwaysPrintf(("\n---------------------\nNotification Consumer started!\n"));
AJ_AlwaysPrintf(("DISMISS_DELAY_PERIOD: %u ms\n", DISMISS_DELAY_PERIOD));
AJ_AlwaysPrintf(("---------------------\n\n"));
return status;
}
示例13: WSL_PrintScan
void WSL_PrintScan(void)
{
int i;
for (i = 0; i < list.size; i++) {
AJ_AlwaysPrintf(("%-17.17s ", list.list[i].ssid));
AJ_AlwaysPrintf(("RSSI: %u ", list.list[i].rssi));
AJ_AlwaysPrintf(("BSSID: %02x:%02x:%02x:%02x:%02x:%02x\n",
list.list[i].bssid[0],
list.list[i].bssid[1],
list.list[i].bssid[2],
list.list[i].bssid[3],
list.list[i].bssid[4],
list.list[i].bssid[5]));
}
}
示例14: AppDoWork
static void AppDoWork()
{
/*
* This function is called if there are no messages to unmarshal
*/
AJ_AlwaysPrintf(("do work\n"));
}
示例15: run_wsl_simulate_ping_recv
/*
* This test builds a ping response in a simulated wire buffer, and then parses the response
*/
static void run_wsl_simulate_ping_recv(const struct test_case* test)
{
AJ_AlwaysPrintf(("\n\n**************\nTEST: %s\n\n", __FUNCTION__));
ResetFakeWireBuffers();
AJ_WSL_NET_ping_FAKERESPONSE();
AJ_WSL_HTC_ProcessIncoming();
}