ADVANCED: navFormUploadFile (Function)

Top  Previous  Next

Architecture:

NX32 / NX32L

Device support:

MX2 turbo/encore/warp, AX9 turbo, NX-200, NX-400, NX-900, LX2, LX4, LX5

Firmware version:

4.70 / 1.30.00

Nav. API level:

12


This function will start to transfer a custom form file to the navigation device.

A "GPI progress" event is raised when there are changes to the progress and/or status of the file transfer. See also navWaitEvent for event # 9.

The custom form file is an XML file that follows the format specified in "custom_forms.xsd", which is part of the Garmin Fleet Management SDK, available at http://developer.garmin.com/fleet-management/overview/.

The file can optionally be compressed with the GZIP format.

 

When the upload is completed, navGPIProgressReceive will report any errors with the form.

In addition to the common errors, the following errors can happen:

267

- Form element is incomplete

268

- Form title length is too long

269

- Item element is incomplete

270

- An Item elements parent is not a Form element

271

- Item ID is used more than once

272

- Item title length is too long

273

- Item default value length is too long

274

- Item count is out of range

275

- A Type elements parent is not an Item element

276

- Type count is out of range

277

- Text length is out of range

278

- Placeholder text is too long

279

- Integer length is out of range

280

- Minimum integer value range error

281

- Maximum integer value range error

282

- Minimum integer value is greater than the maximum integer value

283

- Option element is incomplete

284

- An Option elements parent is not a single select or multiple select element

285

- Option ID is used more than one time for a given Item

286

- Option title length is too long

287

- Option count is out of range for an item

288

- Month value is out of range

289

- Day value is out of range

290

- Year value is out of range

291

- Number of days in the month is not valid

292

- “Use Current” is set to False and no date was specified

293

- Hour value is out of range

294

- Minute value is out of range

295

- Second value is out of range

296

- “Use Current” is set to False and no time was specified

297

- Unknown form Item type

298

- Picture count is out of range

357-395

- XML Parsing Error. There can be many causes for this error, a common cause is that it contains invalid characters.

461

- Exceeds 30 forms on device

 

Note: To create the forms on the RTCU device, use the navFormCreate and navFormUpload functions instead.

 

Input:

filename : STRING

The name and path of the file to transfer.

 

ID : STRING

A small text message to identify the file.

Must be between 1 and 16 characters.

 

 

Returns: INT

0

- Success.

-1

- Navigation interface is not open.

-2

- Error communicating with navigation device.

-3

- File not found.

-4

- The navigation device rejected the command.

-8

- Invalid ID.

-11

- Forms are not supported.

-12

- Navigation interface is busy.

 

Declaration:

FUNCTION navFormUploadFile : INT;
VAR_INPUT
  filename : STRING;
  id       : STRING;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM NavigationExample;
 
BEGIN
  ...
  // Start transfer of custom form
  navFormUploadFile(filename := "form01.xml", id := "Form 1");
  ...
END;
END_PROGRAM;