22 lines
		
	
	
		
			471 B
		
	
	
	
		
			C
		
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			471 B
		
	
	
	
		
			C
		
	
	
	
#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);
 | 
						|
    }
 | 
						|
} |