Carman Daemon API description
*************************************

Copyright (C) 2008  Claudio Takahasi <claudio.takahasi@openbossa.org>
Copyright (C) 2008  Cidorvan Leite <cidorvan.leite@openbossa.org>
Copyright (C) 2008  Felipe Zimmerle <felipe.costa@openbossa.org>
Copyright (C) 2008  Anderson Briglia <anderson.briglia@openbossa.org>

Configuration hierarchy
=======================

Service      org.indt.carmand
Interface    org.indt.carmand.Configuration
Object path  /org/indt/carmand

Methods

		int32 GetTimePrecision()

			Returns current time precision for trip data in
			seconds.


		void SetTimePrecision(int32 time)

			Updates current time precision for trip data in
			seconds.

			Possible errors: org.indt.Error.InvalidArguments

		string GetOBDDevice()

			Returns current address of configured OBD-II
			device.

		void SetOBDDevice(string obdDevice)

			Updates OBD-II device configuration.

			Possible errors: org.indt.Error.InvalidArguments

		string GetGPSDevice()

			Returns current address of configured GPS device.
			Returns "internal" if N810's internal gps is configured.

		void SetGPSDevice(string gpsDevice)

			Updates GPS device configuration.
			Possible values are: "none" - No GPS configured;
			"internal" - Internal GPS device (N810);
			"<address>" - Bluetooth address of GPS device

			Possible errors: org.indt.Error.InvalidArguments

		string GetMode()

			Returns current execution mode. Available modes: "simulator",
			"normal"

		void SetMode(string mode)

			Set execution mode. This configuration changes the GPS
			and OBD connection behaviour.

			Possible errors: org.indt.Error.InvalidArguments

		int32 GetTripSensors()

			(TODO: Not implemented, trip sensors are constant
			for now).

			Returns current sensors selected for trip recording.
			Array of integers.

		void SetSensors(int32 sensors[MAX_TRIP_SENSORS])

			(TODO: Not implemented, trip sensors are constant
			for now).

			Updates selected sensors for trip recording. Array
			of integers.

			Possible errors: org.indt.Error.InvalidArguments

		int32 GetMaxTripTime()

			Returns maximum trip duration in hours.

		void SetMaxTripTime(int32 hours)

			Updates maximum trip duration for trip recording
			in hours.
			hours = -1 will disable trip hours control.

			Possible errors: org.indt.Error.InvalidArguments

		void SaveConfiguration()

			Saves current configuration on
			/home/user/.carman/carmand.conf file.

			Possible errors: org.indt.Error.Failed

		void DiscardConfiguration()

			Discards all changes made since last save or load.

Signals

		void ConfigurationSaved()

			After sucessfully saving all configuration, this
			signal is sent.

		void ConfigurationDiscarded()

			After discarding all configuration changes, this
			signal is sent.


GPS Hierarchy
============

Service		org.indt.carmand
Interface	org.indt.carmand.GPS
Object path  	/org/indt/carmand


Methods
		void Connect()
			Wrapper function to gpsconnect(). Connect to GPS using
			location_connect()

			Possible errors: org.indt.carmand.Error.NotReady

		void Disconnect()
			Wrapper function to gpsdisconnect(). Disconnect from
			GPS using location_disconnect()a

			Possible errors: org.indt.carmand.Error.NotReady

		string Status()

			Returns the GPS status.
			Possible values: Connecting, Fixing, Fixed,
			Disconnected.

			Possible errors: org.indt.carmand.Error.NotReady

Signals
		StatusChanged(string status)

			When GPS status changes this signal is emitted.
			Possible status values are: Connecting, Fixing, Fixed,
			Disconnected.

		DataAvailable(int32 mode, double latitude, double longitude,
				double altitude, doube speed, double track)

			When new GPS data arrived, this signal is emitted.

OBD Hierarchy
=============

Service		org.indt.carmand
Interface	org.indt.carmand.OBD
Object path	/org/indt/carmand


Methods
		void ConnectBT()

			Wrapper function to obd_connect_bt(). Use bt addr
			from config file. Requests OBD to connect.

			Possible errors: org.indt.carmand.Error.NotReady
					 org.indt.carmand.Error.ConnectionAttemptFailed

		void ConnectSerial(string serial_addr)

			Wrapper function to obd_connect_serial(). Receives a
			serial device path as argument. Use serial for OBD
			connection.

			Possible errors: org.indt.carmand.Error.ConnectionAttemptFailed
					 org.indt.carmand.Error.InvalidArguments

		void StartSimulator(string file)

			Wrapper function to obd_start_simulator(). Receives a
			file path as argument. Starts the OBD simulator.

			Possible errors: org.indt.carmand.Error.ConnectionAttemptFailed
					 org.indt.carmand.Error.InvalidArguments

		void Disconnect()

			Wrapper function to obd_disconnect(). Disconnects OBD.

			Possible errors: org.indt.carmand.Error.ConnectionAttemptFailed

		string Status()

			Wrapper function to char* obd_thread_connection_status().
			Returns OBD status.

		int32 AddTimeSensors(int32 pid, int32 interval)

			Wrapper function to obd_add_time_sensor(). Add 'pid'
			into time sensors list.
			Returns < 0 if an error occurred.

			Possible errors: org.indt.carmand.Error.InvalidArguments

		int32 DelTimeSensors(int32 pid)

			Wrapper function to obd_del_time_sensor().
			Delets 'pid' from timer sensors list.
			Returns <= 0 if an error occurred.

			Possible errors: org.indt.carmand.Error.InvalidArguments

		int32 AddRoundSensors(int32 pid, int32 interval, int32 round)

			Wrapper function to obd_add_round_sensor().
			Adds 'pid' on round sensors list. 'interval' is used on
			round-robin schedule.
			Returns < 0 if an error occurred.

			Possible errors: org.indt.carmand.Error.InvalidArguments

		void RequestDTCList()

			Request DTC list from OBD.

			Possible errors: org.indt.org.carmand.Error.NotReady

Signals

		StatusChanged(string status)

			When OBD status changes this signal is emitted.

		DataAvailable(int32 pid, double value1, double value2)

			When new data is collected from command queue, this
			signal will inform new data value.

		DTCList(char dtc_list[])

			Returns a strings array containing DTC list sensors.

Trip Hierarchy
==============

Service		org.indt.carmand
Interface	org.indt.carmand.Trip
Object path	/org/indt/carmand

Methods
		void FlushData()
			Flush trip file to disk.

		void ResetTrip()
			Reset actual trip.

		string ActualTripFolder()

			Returns actual trip folder used for storage.

		void LastGPSData()

			Returns last gps data following this scheme:
			int32 gps_mode, double latitude, double longitude,
			double altitude, double track, double speed.

			Possible errors: org.indt.carmand.Error.NotReady

		void LastOBDData()

			Returns last obd data: double value1, double value2.

			Possible errors: org.indt.carmand.Error.NotReady

Signals
		DataFlushed()

			Signal emitted when data is flushed to disk.
