Receiving File in AMBA Protocol after "AMBA_GET_FILE" command has been sent

0

I am trying to create an app for Camera Devices operating on AMBA Protocol. The camera is connected to a laptop/mobile device with WiFi. Everything seems to work except when I try to receive or download a file.

According to AMBA Api, AMBA_GET_FILE is described as below

AMBA_GET_FILE

AMBA_GET_FILE msg_id: 0x00000505(1285)

API Overview:

• Type: Function

• Description: This API is used to retrieve a file. This command differs from a generic file get, such as an HTTPGET, as it has no TCP/IP dependency and works equally well over Bluetooth or WiFi.

This command is executed in a two-step fashion. First, the camera begins transmitting the requested file (The assumption is that the requested file is found). The return value, rval, only implies a successful file retrieval and commencement of transmission to the handheld.

Upon the completion of file transfer, the camera will send a completion notification AMBA_NOTIFICATION>GET_FILE_COMPLETE. The handheld should only infer a successful transfer when it receives this notification.

• Note: Send AMBA_SET_CLNT_INF0 command to specify client information before AMBA_GET_FILE starts.

• Direction: From the handheld to the camera.

enter image description here

enter image description here

enter image description here

I am using a very basic socket connection to interact with the device using these commands. The request is sent and correct response is received.

However, there is no reception of file and the stream gets stuck. I've tried

  • Receiving on same TCP Socket
  • Creating a simultaneous UDP client with lot of combinations

The code to exchange command is simple. I am using C# for the process

public static TcpClient clientSocket;
if (!clientSocket.Connected)
{
     clientSocket.Connect("192.168.42.1", 7878);
}
else
{

}
serverStream = clientSocket.GetStream();
String cmd = "{'token': " + TOKEN + ", 'msg_id': 11}";
byte[] outStream = Encoding.ASCII.GetBytes(cmd);
serverStream.Write(outStream, 0, outStream.Length);
serverStream.Flush();


byte[] inStream = new byte[1002500];
serverStream.Read(inStream, 0, (int)clientSocket.ReceiveBufferSize);
string returndata = Encoding.ASCII.GetString(inStream);

Everything seems to function properly, except the file transfer.

c#
wifi
amba
asked on Stack Overflow Dec 16, 2019 by user1523595

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0