tesses.broadcast/libbroadcast/broadcastserver.c

22 lines
471 B
C
Raw Normal View History

2024-03-26 19:34:54 +00:00
#include <tessesbroadcast.h>
#include <string.h>
char* name;
void handle(broadcast_server_ctx_t* ctx)
{
if(strcmp(ctx->serviceName,"Test") == 0)
{
printf("Got one\n");
ctx->serviceUrl = broadcast_fromconst("http://127.0.0.1:80/");
ctx->deviceName=broadcast_fromconst(name);
ctx->toSend=true;
}
}
int main(int argc,char** argv)
{
if(argc > 1)
{
name = argv[1];
broadcast_server(handle,6942);
}
}