• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ AJ_AlwaysPrintf函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中AJ_AlwaysPrintf函数的典型用法代码示例。如果您正苦于以下问题:C++ AJ_AlwaysPrintf函数的具体用法?C++ AJ_AlwaysPrintf怎么用?C++ AJ_AlwaysPrintf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了AJ_AlwaysPrintf函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:narcijie,项目名称:alljoyn-triton,代码行数:34,代码来源:Services_Handlers.cpp


示例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;
}
开发者ID:BillyZhangZ,项目名称:wifi,代码行数:25,代码来源:ServerSample.c


示例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;
}
开发者ID:avernon,项目名称:asl_distribution,代码行数:25,代码来源:EventsAndActionsSample.c


示例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;
}
开发者ID:durake,项目名称:core-ajtcl,代码行数:32,代码来源:SecureService.c


示例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");
        }
    }
}
开发者ID:fonlabs,项目名称:ajtcl,代码行数:31,代码来源:unit_test.c


示例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));
    }
}
开发者ID:gwgoliath,项目名称:learnalljoyn,代码行数:7,代码来源:clientlite.c


示例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) {
    }
}
开发者ID:henjuv,项目名称:ajtcl-s20c,代码行数:26,代码来源:alljoyn.c


示例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;
}
开发者ID:durake,项目名称:core-ajtcl,代码行数:43,代码来源:SecureClient.c


示例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;
}
开发者ID:gwgoliath,项目名称:learnalljoyn,代码行数:12,代码来源:signalConsumer_client.c


示例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);
}
开发者ID:fonlabs,项目名称:ajtcl,代码行数:13,代码来源:uarttest.c


示例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;
}
开发者ID:avernon,项目名称:asl_distribution,代码行数:14,代码来源:SimpleNotificationConsumerSample.c


示例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;
}
开发者ID:avernon,项目名称:asl_distribution,代码行数:15,代码来源:SimpleNotificationConsumerSample.c


示例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]));
    }
}
开发者ID:fonlabs,项目名称:ajtcl,代码行数:15,代码来源:aj_wsl_net.c


示例14: AppDoWork

static void AppDoWork()
{
    /*
     * This function is called if there are no messages to unmarshal
     */
    AJ_AlwaysPrintf(("do work\n"));
}
开发者ID:durake,项目名称:core-ajtcl,代码行数:7,代码来源:due_led.cpp


示例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();
}
开发者ID:fonlabs,项目名称:ajtcl,代码行数:10,代码来源:unit_test.c


示例16: OnboardingReadInfo

AJ_Status OnboardingReadInfo(AJOBS_Info* info)
{
    AJ_Status status = AJ_OK;
    size_t size = sizeof(AJOBS_Info);
    AJ_NV_DATASET* nvramHandle;
    int sizeRead;

    if (NULL == info) {
        return AJ_ERR_NULL;
    }
    memset(info, 0, size);

    if (!AJ_NVRAM_Exist(AJ_OBS_OBINFO_NV_ID)) {
        return AJ_ERR_INVALID;
    }

    nvramHandle = AJ_NVRAM_Open(AJ_OBS_OBINFO_NV_ID, "r", 0);
    if (nvramHandle != NULL) {
        sizeRead = AJ_NVRAM_Read(info, size, nvramHandle);
        status = AJ_NVRAM_Close(nvramHandle);
        if (sizeRead != sizeRead) {
            status = AJ_ERR_READ;
        } else {
            AJ_AlwaysPrintf(("Read Info values: state=%d, ssid=%s authType=%d pc=%s\n", info->state, info->ssid, info->authType, info->pc));
        }
    }

    return status;
}
开发者ID:avernon,项目名称:asl_distribution,代码行数:29,代码来源:OnboardingSample.c


示例17: AppHandleCat

AJ_Status AppHandleCat(AJ_Message* msg)
{
    AJ_Status status = AJ_OK;
    AJ_Message reply;
    char* partA;
    char* partB;
    char* totalString;
    AJ_AlwaysPrintf(("%s:%d:%s %d\n", __FILE__, __LINE__, __FUNCTION__, 0));

    AJ_UnmarshalArgs(msg, "ss", &partA, &partB);

    totalString = (char*) AJ_Malloc(strlen(partA) + strlen(partB) + 1);
    if (!totalString) {
        return AJ_ERR_RESOURCES;
    }
    strcpy(totalString, partA);
    strcpy(totalString + strlen(partA), partB);

    AJ_MarshalReplyMsg(msg, &reply);
    AJ_MarshalArgs(&reply, "s", totalString);

    status = AJ_DeliverMsg(&reply);
    AJ_Free(totalString);
    return status;
}
开发者ID:fonlabs,项目名称:ajtcl,代码行数:25,代码来源:bastress2.c


示例18: TestTimeConversion

void TestTimeConversion()
{
    TS_Time time;
    TS_Date date;
    AJ_Time ajtime;
    uint8_t dow;
    const char* WEEKDAYS[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };

    ajtime.seconds = 1409262479; // Thu, 28 Aug 2014 21:47:59 GMT
    ajtime.milliseconds = 66;
    AJ_AlwaysPrintf(("epoch %u.%03u\n", ajtime.seconds, ajtime.milliseconds));
    AJTime2TSDateTime(&ajtime, &date, &time);
    dow = TSDateTime2AJTime(&date, &time, &ajtime);
    AJ_AlwaysPrintf(("%s %02u/%02u/%02u %02u:%02u:%02u.%03u\n", WEEKDAYS[dow - 1], date.day, date.month, date.year, time.hour, time.minute, time.second, time.milliseconds));
    AJ_AlwaysPrintf(("epoch %u.%03u\n", ajtime.seconds, ajtime.milliseconds));
}
开发者ID:dengcj0,项目名称:QCA4010,代码行数:16,代码来源:TimeServerSample.c


示例19: AuthListenerCallback

static AJ_Status AuthListenerCallback(uint32_t authmechanism, uint32_t command, AJ_Credential* cred)
{
    AJ_Status status = AJ_ERR_INVALID;

    AJ_AlwaysPrintf(("AuthListenerCallback authmechanism %08X command %d\n", authmechanism, command));

    switch (authmechanism) {
    case AUTH_SUITE_ECDHE_NULL:
        cred->expiration = keyexpiration;
        status = AJ_OK;
        break;

    case AUTH_SUITE_ECDHE_PSK:
        switch (command) {
        case AJ_CRED_PUB_KEY:
            cred->data = (uint8_t*) psk_hint;
            cred->len = strlen(psk_hint);
            cred->expiration = keyexpiration;
            status = AJ_OK;
            break;

        case AJ_CRED_PRV_KEY:
            cred->data = (uint8_t*) psk_char;
            cred->len = strlen(psk_char);
            cred->expiration = keyexpiration;
            status = AJ_OK;
            break;
        }
        break;

    default:
        break;
    }
    return status;
}
开发者ID:avernon,项目名称:asl_distribution,代码行数:35,代码来源:sessionslite.c


示例20: ScanResult

static void ScanResult(void* context, const char* ssid, const uint8_t mac[6], uint8_t rssi, AJ_WiFiSecurityType secType, AJ_WiFiCipherType cipherType)
{
    static const char* const sec[] = { "OPEN", "WEP", "WPA", "WPA2" };
    static const char* const typ[] = { "", ":TKIP", ":CCMP", ":WEP" };

    AJ_AlwaysPrintf(("SSID %s [%02x:%02X:%02x:%02x:%02x:%02x] RSSI=%d security=%s%s\n", ssid, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], rssi, sec[secType], typ[cipherType]));
}
开发者ID:henjuv,项目名称:ajtcl-s20c,代码行数:7,代码来源:alljoyn.c



注:本文中的AJ_AlwaysPrintf函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ AJ_DeliverMsg函数代码示例发布时间:2022-05-30
下一篇:
C++ AJFREE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap