From b4b3abb33cf07fb0ef00c81fc5592e5e7667e717 Mon Sep 17 00:00:00 2001 From: Florent Duchon Date: Wed, 16 May 2012 17:36:32 +0200 Subject: digital/beacon: add get coord and get trust API --- digital/beacon/src/position.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'digital/beacon/src/position.c') diff --git a/digital/beacon/src/position.c b/digital/beacon/src/position.c index 75fbad48..f3320321 100644 --- a/digital/beacon/src/position.c +++ b/digital/beacon/src/position.c @@ -153,4 +153,26 @@ int update_position(uint16_t beaconID, uint16_t angleID, float angle) last_ID[0] = beaconID; } return 0; +} + +/* This function returns the requested coord according to the opponent number */ +int16_t position_get_coord(TOpponent_ID id, TCoord_type type) +{ + switch(type) + { + case X: + return opponent[id].x; + break; + case Y: + return opponent[id].y; + break; + default: + return 0; + } +} + +/* This function returns the trust according to opponent number */ +int8_t position_get_trust(TOpponent_ID id) +{ + return opponent[id].trust; } \ No newline at end of file -- cgit v1.2.3