Send Courses

For devices that support fitness data (i.e. Edge and Forerunner), this is an example of writing course data to the device. Try it out.

Example

This is the simplest way to provide the course data to the device since the Javascript object formats the data into CRS.

var display = new Garmin.DeviceDisplay("garminDisplay", {
  pathKeyPairsArray: ["http://developer.garmin.com/","ee3934433a35ee348583236c2eeadbc1"],
  unlockOnPageLoad: false,					// minimizes overhead on page load
  findDevicesButtonText: "Write Course",		// allows you to customize the action text
  showCancelFindDevicesButton: false,			// no need to cancel small data transfers
  autoSelectFirstDevice: true,				// picks the first device found
  autoWriteData: true,						// automatically write the data once devices found
  showReadDataElement: false,					// autoWriteData eliminates need for this
  getWriteData: function() { return $("dataString").value;  },		// provides data to write
  getWriteDataFileName:		function(){ return "course.crs"; },		// provides filename to write to
  writeDataType:	Garmin.DeviceControl.FILE_TYPES.crs					// indicates fitness course data
  });

User Interface

Buttons and Status Area

Course Write Screenshot

As you can see, the example above is quite simple. Additional optional elements can be added to the interface by setting the appropriate variable values in the Javascript Object, such as allowing the user to view the status of the course write. A full list of options is available here.