diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/Messenger.c | 8 | ||||
-rw-r--r-- | core/Messenger.h | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/core/Messenger.c b/core/Messenger.c index f77b4491..148c3350 100644 --- a/core/Messenger.c +++ b/core/Messenger.c | |||
@@ -234,12 +234,18 @@ int setname(uint8_t * name, uint16_t length) | |||
234 | return 0; | 234 | return 0; |
235 | } | 235 | } |
236 | 236 | ||
237 | int getname(uint8_t *name) | ||
238 | { | ||
239 | memcpy(name, self_name, sizeof(self_name)); | ||
240 | return 0; | ||
241 | } | ||
242 | |||
237 | /* get name of friendnumber | 243 | /* get name of friendnumber |
238 | put it in name | 244 | put it in name |
239 | name needs to be a valid memory location with a size of at least MAX_NAME_LENGTH bytes. | 245 | name needs to be a valid memory location with a size of at least MAX_NAME_LENGTH bytes. |
240 | return 0 if success | 246 | return 0 if success |
241 | return -1 if failure */ | 247 | return -1 if failure */ |
242 | int getname(int friendnumber, uint8_t * name) | 248 | int getfriendname(int friendnumber, uint8_t * name) |
243 | { | 249 | { |
244 | if (friendnumber >= numfriends || friendnumber < 0) | 250 | if (friendnumber >= numfriends || friendnumber < 0) |
245 | return -1; | 251 | return -1; |
diff --git a/core/Messenger.h b/core/Messenger.h index 7263901c..08f6de2a 100644 --- a/core/Messenger.h +++ b/core/Messenger.h | |||
@@ -92,12 +92,16 @@ int m_sendmessage(int friendnumber, uint8_t *message, uint32_t length); | |||
92 | return -1 if failure */ | 92 | return -1 if failure */ |
93 | int setname(uint8_t *name, uint16_t length); | 93 | int setname(uint8_t *name, uint16_t length); |
94 | 94 | ||
95 | /* Get our own nickname | ||
96 | Set's name to the our own nickname */ | ||
97 | int getname(uint8_t *name); | ||
98 | |||
95 | /* get name of friendnumber | 99 | /* get name of friendnumber |
96 | put it in name | 100 | put it in name |
97 | name needs to be a valid memory location with a size of at least MAX_NAME_LENGTH (128) bytes. | 101 | name needs to be a valid memory location with a size of at least MAX_NAME_LENGTH (128) bytes. |
98 | return 0 if success | 102 | return 0 if success |
99 | return -1 if failure */ | 103 | return -1 if failure */ |
100 | int getname(int friendnumber, uint8_t *name); | 104 | int getfriendname(int friendnumber, uint8_t *name); |
101 | 105 | ||
102 | /* set our user status | 106 | /* set our user status |
103 | you are responsible for freeing status after | 107 | you are responsible for freeing status after |