renamed getname to getfriendname and added a getname function to get the name of our client

This commit is contained in:
Peter Maatman 2013-07-30 17:09:09 +02:00
parent d503941f6c
commit 12b19f6910
2 changed files with 12 additions and 2 deletions

View File

@ -234,12 +234,18 @@ int setname(uint8_t * name, uint16_t length)
return 0;
}
int getname(uint8_t *name)
{
memcpy(name, self_name, sizeof(self_name));
return 0;
}
/* get name of friendnumber
put it in name
name needs to be a valid memory location with a size of at least MAX_NAME_LENGTH bytes.
return 0 if success
return -1 if failure */
int getname(int friendnumber, uint8_t * name)
int getfriendname(int friendnumber, uint8_t * name)
{
if (friendnumber >= numfriends || friendnumber < 0)
return -1;

View File

@ -92,12 +92,16 @@ int m_sendmessage(int friendnumber, uint8_t *message, uint32_t length);
return -1 if failure */
int setname(uint8_t *name, uint16_t length);
/* Get our own nickname
Set's name to the our own nickname */
int getname(uint8_t *name);
/* get name of friendnumber
put it in name
name needs to be a valid memory location with a size of at least MAX_NAME_LENGTH (128) bytes.
return 0 if success
return -1 if failure */
int getname(int friendnumber, uint8_t *name);
int getfriendname(int friendnumber, uint8_t *name);
/* set our user status
you are responsible for freeing status after