AT#M2MWRITE

#M2MWRITE – M2M File System File Write

SELINT 2

AT#M2MWRITE=<file_name>,<size>[,<permission>]

Execution command causes the module to store a generic file, for example M2M Application binary file, in the M2M file system in the current working directory, naming it <file_name>

 

The file should be sent using RAW ASCII file transfer. It is important to set properly the port settings. In particular: Flow control: hardware.

 

Parameters:

<file_name> – file name in M2M file system, quoted string type (up to max 16 chars

depending on current working directory, case sensitive).

 

<size> – file size in bytes

 

<permission> – file permission (optional); sum of integers each representing a file

permission; default value if not present is 0;

  0 - nothing

  1 - executable binary (.bin)

16 - compressed (.gz)

 

If the parameter <permission> is present, it is not 0, its value matches file name extension (e.g.: 1 - .bin; 16 - .gz, 17 - .bin.gz) the file will be stored in the M2M file system in drive 0 in the directory \MOD setting the requested file permission.

If the parameter <permission> is not present the file will be stored in the M2M file system in the current working directory without setting any file permission.

 

The device shall prompt a five character sequence

<CR><LF><greater_than><greater_than><greater_than>

(IRA 13, 10, 62, 62, 62)

after command line is terminated with <CR>; after that a file can be entered from TE, sized <size> bytes.

 

The operations complete when all bytes are received.

 

If writing ends successfully, the response is OK; otherwise, an error code is reported.

 

Note: the file name should be passed between quotes; file names are case sensitive.

AT#M2MWRITE=?

Test command returns OK result code.

Example

AT#M2MWRITE="M2MAPZ.bin",58044

>>> here receive the prompt; then type or send the file, sized 58044 bytes

OK

File has been stored