Пример #1
0
 public void OnMessageSendEvent(Message message)
 {
     Clients.Others.onMessageSendEvent(message.ToString());
 }
Пример #2
0
        public void SendMessage(Message message)
        {
            message.incoming = false;

            if (OnMessageSendEvent != null)
                OnMessageSendEvent(message);

            DebugTxRx(String.Format("TX: {0}", message.ToString()));

            string mes = String.Format("{0};{1};{2};{3};{4};{5}\n",
                message.nodeId,
                message.sensorId,
                (int)message.messageType,
                (message.ack) ? "1" : "0",
                message.subType,
                message.payload);

            SendMessage(mes);

            if (storeMessagesToLog)
                messagesLog.AddNewMessage(message);
        }