c++ programlama kitapları 0 dan baslangıs seviyesin itibaren 75 den fazla
kitap arsivi
arsiv1
http://bc.vc/HTmutu
veya
http://bc.vc/Ox8uMu
arsiv 2
http://bc.vc/io0GSG
veya
http://bc.vc/f5dgmg
arsıv3
http://bc.vc/OQdXgX
veya
http://bc.vc/skCSFS
arsiv 4
http://bc.vc/JbCIKI
veya
http://bc.vc/F6uHKH
her hersivde birbirinde farklı c++ proglama ilgili kaynaklar mevcutur
kulanmaıcı tafsiye ederim
ücretsiz bu kaynaklardan memlun kalacagınıcı garanti ediyorum
>
>
> #include <unistd.h>
>
>
> #include <stdlib.h>
>
>
> #include <string>
>
>
> #include <termios.h>
>
>
> #include <fcntl.h>
>
>
> #include <sys/signal.h>
>
>
>
>
> #define BAUDRATE B9600
>
>
> #define DEVICE "/dev/ttyO4"
>
>
> #define _POSIX_SOURCE 1
>
>
>
>
> #define FALSE 0
>
>
> #define TRUE 1
>
>
> volatile int STOP=FALSE;
>
>
> int wait_flag=FALSE;
>
>
>
>
> using namespace std;
>
>
>
>
> void signal_handler_IO (int status){
>
>
>
>
> cout << "received SIGIO signal "<< endl;
>
>
> wait_flag = FALSE;
>
>
> }
>
>
>
>
> int main()
>
>
> {
>
>
> int fd, c, res;
>
>
> struct termios oldtio, newtio;
>
>
> struct sigaction saio;
>
>
> char buffer [255];
>
>
>
>
> system ("echo BB-UART4 > /sys/devices/bone_capemgr.8/slots");
>
>
>
>
> fd = open (DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK);
>
>
> if (fd <0) {perror(DEVICE); exit (-1);}
>
>
>
>
> /*install the siganl handler before making the device ansynhronous */
>
>
> saio.sa_handler = signal_handler_IO;
>
>
> saio.sa_mask.__val[0] = 0;
>
>
> saio.sa_mask.__val[1] = 0;
>
>
> saio.sa_mask.__val[2] = 0;
>
>
> saio.sa_mask.__val[3] = 0;
>
>
> saio.sa_flags = 0;
>
>
> saio.sa_restorer = NULL;
>
>
> sigaction(SIGIO, &saio, NULL);
>
>
>
>
> /* Allow the process to receive SIGIO */
>
>
> fcntl(fd, F_SETOWN, getpid());
>
>
> /* Make the file descriptor ansynchronous */
>
>
> fcntl(fd, F_SETFL, FASYNC);
>
>
>
>
> tcgetattr(fd,&oldtio);
>
>
>
>
> newtio.c_cflag = BAUDRATE | CS8 | CLOCAL | CREAD;
>
>
> newtio.c_iflag = IGNPAR | ICRNL;
>
>
> newtio.c_oflag = 0;
>
>
> newtio.c_lflag = ICANON;
>
>
> newtio.c_cc[VMIN]=1;
>
>
> newtio.c_cc[VTIME]=0;
>
>
> /* Clean the modem line and activate the settings for the port */
>
>
> tcflush(fd,TCIFLUSH);
>
>
> tcsetattr(fd,TCSANOW,&newtio);
>
>
>
>
> //------------ WRITE
>
>
>
>
>> c = write (fd, "AA", 4);
>> if ( c < 0)
>> fputs ("write() of 4bits failed!\n", stderr);
>
>
>
>
> //--------------READ
>
>
>
>
>
>
>
> while(STOP==FALSE) {
>
>
>
>
> usleep(1000000);
>
>
> putchar ('*'); fflush(stdout);
>
>
>
>
> if(wait_flag==FALSE) {
>
>
> buffer[res]=NULL;
>
>
> res = read (fd,buffer,sizeof(buffer));
>
>
>
>
> printf(":%s :%d\n", buffer, res);
>
>
> if (res==1) STOP=TRUE;
>
>
>
>
> wait_flag = TRUE;
>
>
> }
>
>
>
>
> }
>
>
>
>
>
>
> //restore old port settings
>
>
> tcsetattr(fd,TCSANOW, &oldtio);
>
>
>
>
> close (fd);
>
>
> return 0;
>
>
> }
>
>
>
>
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.