private void SendMessageBlobFileInfo() { CRbHeader rbh = new CRbHeader(); rbh.RoutingType = CRoboType.D2D; rbh.RoutingKeyword = CRoboType.Default; rbh.AppId = CRoboType.SbrApiServices; rbh.AppProcessingId = ""; rbh.MessageId = CRoboType.BlobFileInfo; ++sendCount; rbh.MessageSeqno = sendCount.ToString(); rbh.SendDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); CRbBodyBlobData rbb = new CRbBodyBlobData(); rbb.blobFileName = this.uploadedFileName; rbb.storageAccount = this.storageAccount; rbb.storageKey = this.storageKey; rbb.storageContainer = this.storageContainer; CRoboMessage message = new CRoboMessage(); message.RbHeader = rbh; message.RbBody = rbb; string strMessage = JsonConvert.SerializeObject(message); SendDeviceToCloudMessagesAsync(strMessage); }
private void SendMessageVisionInit() { CRbHeader rbh = new CRbHeader(); rbh.RoutingType = CRoboType.CALL; rbh.RoutingKeyword = CRoboType.Default; rbh.AppId = CRoboType.SbrApiServices; rbh.AppProcessingId = CRoboType.RbAppVisionApi; rbh.MessageId = CRoboType.Init; ++sendCount; rbh.MessageSeqno = sendCount.ToString(); rbh.SendDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); CRbBodyBasic rbb = new CRbBodyBasic(); rbb.visitor = ""; CRoboMessage message = new CRoboMessage(); message.RbHeader = rbh; message.RbBody = rbb; string strMessage = JsonConvert.SerializeObject(message); SendDeviceToCloudMessagesAsync(strMessage); }
private void SendMessageVisionAnalyze(string routingType) { CRbHeader rbh = new CRbHeader(); rbh.RoutingType = routingType; rbh.RoutingKeyword = CRoboType.Default; rbh.AppId = CRoboType.SbrApiServices; rbh.AppProcessingId = CRoboType.RbAppVisionApi; rbh.MessageId = CRoboType.Analyze; ++sendCount; rbh.MessageSeqno = sendCount.ToString(); rbh.SendDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); CRbBodyVisionAnalyze rbb = new CRbBodyVisionAnalyze(); rbb.visitor = ""; rbb.visitor_id = ""; rbb.blobFileName = uploadedFileName; if (routingType == CRoboType.D2D) { rbb.deleteFile = CRoboType.False; SendMessageBlobFileInfo(); } else { rbb.deleteFile = CRoboType.True; } CRoboMessage message = new CRoboMessage(); message.RbHeader = rbh; message.RbBody = rbb; string strMessage = JsonConvert.SerializeObject(message); SendDeviceToCloudMessagesAsync(strMessage); }