Skip to content

Commit

Permalink
Added released to
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanchapell committed Oct 18, 2022
1 parent ed15da6 commit b8596de
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
7 changes: 7 additions & 0 deletions library_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#! /bin/bash
gcc -Wall -c ../nic_app/src/nic_app.c -o nic_app.o
mv nic_app.o src
cp ../nic_app/src/nic_app.h src
cd src
export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
gcc -Wall -pthread -o chat chat.c nic_app.o
3 changes: 3 additions & 0 deletions released_to.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Jessicat-H
dylanchapell
tonydoesathing
35 changes: 35 additions & 0 deletions src/chat.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "nic_app.h"

char buf[SIZE] = {0};
uint8_t APP_ID=2;

/**
* Print out the message received
*/
void receiveMessage(uint8_t* message) {
printf("%d: %s \n", message[1], &message[6]);
}

/**
* Initialize the router connection and then listen for user input
*/
int main(){
// init nic_app
nic_app_init(APP_ID, receiveMessage);

// get user input
while (1){
printf("Destination ID: \n");
char destString[5];
fgets(destString,5,stdin);
uint8_t destID = atoi(destString);
printf("Message: \n");
fgets(buf,SIZE-2,stdin); //will this yell at us? lets find out.

send_message(destID,APP_ID,buf,strlen(buf)+1);
}
return 0;
}

0 comments on commit b8596de

Please sign in to comment.