Skip to Content
CTech Digital
  • Home
  • Odoo services
  • AI services
  • Contact us
  • 0
  • Nederlands (BE) English (UK) Français
CTech Digital
  • 0
    • Home
    • Odoo services
    • AI services
    • Contact us
  • Nederlands (BE) English (UK) Français

23/5/2025

  • All Blogs
  • Daily blog
  • 23/5/2025
  • 23 May 2025 by
    CTech Metrology, Luc Wens

    For xenomatix, about the 5G modem:

    Milesight UF31 5G dongle

    Chrome

    • 192.168.1.1
    • admin
    • password


    Applying message service in CTrack

    First I turned back the modifs made to GetReceivePackage, these were made to handle warnings, but will be replaced by the message based communication

    At this moment the proposal for implementation is

    • keep the MessageRouter class as interface
    • Derive CCommunicationInterface from it
    • Do the check and execute of responders in CCommunicationInterface::GetReceivePackage
    • Check if the is really needed in GetReceivePackage, I hope not, the only place the code is used is in DeviceiGPS, so yes, it can be removed

    The main incoming point of communication for both UI and engine is CStateManager::TcpReceiveRespond :
    void CStateManager::TCPReceiveRespond()
    {
        std::unique_ptr<CTCPGram> Telegram;
        bool                      bAvailable = m_TCP.GetReceivePackage(Telegram);
        while (bAvailable)
        {
            unsigned short Code = Telegram->GetCode();
            switch (Code)
            {
                case TCPGRAM_CODE_STRING:
                {
                    std::string ReceivedString;
                    if (Telegram->GetString(ReceivedString))
                        PrintInfo(ReceivedString);
                    else
                        PrintError("Error receiving string");
                };
                break;
                case TCPGRAM_CODE_DOUBLES:
                {
                    CConfiguration *pConfiguration = GetConfigurationLive();
                    if (pConfiguration)
                        pConfiguration->LiveReceive(Telegram);
                };
                break;
                case TCPGRAM_CODE_COMMAND:
                {
                    std::unique_ptr<TiXmlElement> XML   = Telegram->GetXML();
                    CNode                        *pNode = GetNodeFactory()->CreateNodeFromXML(XML.get(), true);
                    if (pNode)
                    {
                        CommandExecute(pNode);
                    }
                    else
                        PrintError("Failed converting the node from XML");
                };
                break;
                case TCPGRAM_CODE_STATUS: // state changing is only allowed by the server, so normally we do not receive states here
                {
                    std::unique_ptr<TiXmlElement> XML = Telegram->GetXML();
                    assert(XML.get() != NULL);
                    CString StateName = StripName(XML->Value());
                    StateUpdate(StateName, XML);
                    if (m_bTCPServer) // reflect our state change immediate if we are server, probably a client is resetting an error state
                        TCPSendStatus(true);
                };
                break;
            }
            // next message
            bAvailable = m_TCP.GetReceivePackage(Telegram);
        }
    }


    orange needs to go

    So we only keep the data coming in

    Responders will be handled inside GetReceivepackage

    The first one to test is a message with ID "warning" 



    in Daily blog
    # Xenomatix
    22/5/2025 ESAT Noordwijk
    Copyright © CTech
    Nederlands (BE) | English (UK) | Français
    Powered by Odoo - The #1 Open Source eCommerce