示例#1
0
文件: tests.cpp 项目: PetRover/rTests
    void testWifiReceiveStatus(const char* ipAddressLocal, const char* ipAddressRemote)
    {
        NetworkManager* ourNetworkManager = new NetworkManager;
        ourNetworkManager->initializeNewConnection("USBSocket", ipAddressLocal, ipAddressRemote, 1024, ConnectionInitType::CONNECT, ConnectionProtocol::TCP);

        NetworkChunk* chunk = new NetworkChunk;
        ourNetworkManager->getData("USBSocket", chunk);

        Status ourStatus(*chunk);
    }
示例#2
0
文件: tests.cpp 项目: PetRover/rTests
    void testWifiReceiveText(const char* ipAddressLocal, const char* ipAddressRemote)
    {
        NetworkManager* ourNetworkManager = new NetworkManager;
        ourNetworkManager->initializeNewConnection("USBSocket", ipAddressLocal, ipAddressRemote, 1024, ConnectionInitType::CONNECT, ConnectionProtocol::TCP);

        NetworkChunk* chunk = new NetworkChunk;
        ourNetworkManager->getData("USBSocket", chunk);

        Text ourTextMessage(*chunk);

        //print out length/data of ourTextMessage
        int length = ourTextMessage.getLength();
        VLOG(2) << "Length of our Message "<< length;

        for (int i=0; i < length; i++)
        {
            VLOG(2) << (ourTextMessage.getTextMessage())[i];
        }
    }