This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* inspiré de https://github.com/atwilc3000/sample/blob/master/Bluetooth/rfcomm_server.c */ | |
| #include <bluetooth/bluetooth.h> | |
| #include <bluetooth/rfcomm.h> | |
| #include <stdio.h> | |
| #include <unistd.h> | |
| #include <sys/socket.h> | |
| #include <stdbool.h> | |
| #define BUFFER_SIZE 1024 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let connect (address: string) port = | |
| let addr = Unix.inet_addr_of_string address in | |
| let inet_addr = Unix.ADDR_INET (addr, port) in | |
| Unix.open_connection inet_addr | |
| let shutdown = Unix.shutdown_connection | |
| let () = | |
| if Array.length Sys.argv < 2 then | |
| Printf.printf "Usage: %s <name>\n" Sys.argv.(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type connection = { | |
| inc: in_channel; | |
| outc: out_channel | |
| } | |
| (** Obtient une chaine de caractère de la forme adresse:port à partir d'une sockaddr *) | |
| let string_of_sockaddr = function | |
| | Unix.ADDR_UNIX a -> a | |
| | Unix.ADDR_INET (inet, port) -> Printf.sprintf "%s:%d" (Unix.string_of_inet_addr inet) port |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (* | |
| color.ml | |
| Author: Trévis MORVANY | |
| *) | |
| (* | |
| This is free and unencumbered software released into the public domain. | |
| Anyone is free to copy, modify, publish, use, compile, sell, or | |
| distribute this software, either in source code form or as a compiled | |
| binary, for any purpose, commercial or non-commercial, and by any |