Sample Programs
Connectionless Mode
print_dlsap(”sending data to ”,rdlsap, rdlsap_len); send_data(send_fd, rdlsap, rdlsap_len, (i + 1) * 10); /* receive the data packet */
recv_len = recv_data(recv_fd);
printf(”received %d bytes, first word = %d\n”, recv_len, data_area[0]);
}
/*
We're finished. Now call cleanup to unbind, then detach, then close the device file.
*/
cleanup(send_fd); cleanup(recv_fd);
}
166 | Appendix A |