AT^SJDL in J2ME | Thales IoT Developer Community
December 21, 2015 - 11:33am, 3039 views
Hi guys,
I am trying to implement a Java program that will download a file into the FFS of the EHSx using UART.
After I put the module into download **** using AT^SJDL=1,<size>,<FileName>\r, I receive CONNECT.
But now what should I do in the code side? Any ideas.
BR,
SRN7
Hello,
Here you can find the Python example:
https://iot-developer.thalesgroup.com/tutorial/python-script-load-files-...
Regards,
Bartłomiej
Hi Bartłomiej,
I have seen the Python example. But I am planning to do it from within the module itself!
Any pointers for that?
BR,
SRN7
Hello,
The AT^SJDL command can be used to send the file directly to the module's file system without any additional application on the module. You need to issue this command on the external interface on which you will send the data.
If you want to implement your own Java MIDlet for that purpose you will need to open the serial connection in the MIDlet, read the data (maybe implement your own protocol and CRC verification) and store the file to FFS with the Java API.
Regards,
Bartłomiej
Hi,
In the MIDlet, I am opening the serial connection, reading the filename and size, and able to put the module in download ****.
I tried opening a DataOutputStream for the ATCommand instance and writing the file contents to it. But that didn't help. I think it works for only open internet connections.
After this when I send the file content, I dont get the URC for completion
BR,
SRN7
Hello,
Could you write more details? I'm not sure what you are doing. If you develop the file transfer in the MIDlet you should implement everything in MIDlet without using AT^SJDL command. If you would like to use the AT^SJDL command it should be issued by the external application which will transfer the data to the module. And then you would not need any MIDlet.
Regards,
Bartłomiej