BiVo EFM32GG12  0.1
An open source foundation foundation for remote monitoring of bird vocalizations.
gen_com.c File Reference

Communication Driver. More...

#include "gen_com.h"

Functions

void genCom_init (void)
 
void handshakeApp (void)
 Handshake with the desktop application. Blocks until handshake operation is complete. Three-step process: get message from computer, echo that message back, and then receive an acknowledge message from the computer again. More...
 
void waitOnRecordMessage (void)
 Block until record message is received. Blocks until the record command is received from the desktop application.
 
int stringCompare (char *str1, char *str2, int len)
 

Variables

char handshake_request [5] = "hands"
 
char handshake_response [5] = "cnfrm"
 
char handshake_ack [5] = "ackng"
 
char record_command [5] = "recrd"
 

Detailed Description

Communication Driver.

This general communication driver implements the communication schema and is designed to be abstracted from the medium-specific communication needs so changing from USB to something else requires minimal modification to this driver.

Author
Kevin Imlay
Date
2-16-21

Function Documentation

◆ genCom_init()

void genCom_init ( void  )

Initialize the general communication module. At this point, only makes sure the serial communication module is initialized.

◆ handshakeApp()

void handshakeApp ( void  )

Handshake with the desktop application. Blocks until handshake operation is complete. Three-step process: get message from computer, echo that message back, and then receive an acknowledge message from the computer again.

Function Prototypes

◆ stringCompare()

int stringCompare ( char *  str1,
char *  str2,
int  len 
)

Compares two strings to each other up to a specified length. Identicial to strcmp but terminates on length instead of null character.

Parameters
str1First string to compare
str2Second string to compare to the first string.
lenThe number of characters to compare
Returns
0 if strings are equal, not 0 otherwise.

Variable Documentation

◆ handshake_request

char handshake_request[5] = "hands"

Message Strings