驅動**:
#include #include #include //#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define device_name "433"
static long t433_ioctl(struct file *filp, unsigned int cmd, unsigned int arg)
else
cmd1=cmd1>>1; //右移
} msleep(8);
//printk("\n\n");
} //printk("t433_ioctl\n");
//printk("cmd=%d\narg=%d\n",cmd,arg);
return 0;
}static struct file_operations dev_fops = ;
static struct miscdevice misc = ;
static int __init dev_init(void)
ret = misc_register(&misc);//應該是在/dev下出那個device_name
printk ("size unsigned = %d\n", sizeof(unsigned));
printk (device_name"\tinitialized\n");
return ret;
}static void __exit dev_exit(void)
module_init(dev_init);
module_exit(dev_exit);
module_license("gpl");
module_author("yangkun");
以上驅動根據自己的協議傳送的。就是一些時序
測試**:
#include #include #include #include #include #include #include int main(int argc, char **argv)
fd = open("/dev/433", 0);
if (fd < 0)
if (fd < 0)
//char a[4]=;
//memcpy(&on, a, 4);
if(on==1)
on=0xee1101c0;
else
on=0xee1100c0;
printf("on=%x\n",on);
ioctl(fd, on, led_no);
close(fd);
return 0;
}
**是根據友善的改的。
八 傳送郵件
傳送郵件 如下 from email.mime.text import mimetext from email.header import header import smtplib import datetime from poseidon.myutil import myutil import ...
5 傳送模板訊息
詳情參看 傳送模板訊息 介面呼叫請求說明 http請求方式 post post資料示例如下 data keynote1 keynote2 keynote3 remark createmunu url,params string url send template url.replace access...
SprongBoot傳送郵件(三)傳送附件郵件
還是在 sprongboot傳送郵件 一 傳送簡單文字郵件helloworld 的配置基礎上新增如下 param to param subject param content param filepath 檔案路徑 throws messagingexception public void send...