RFID Localization Using Angle of Arrival Cluster Forming
继续阅读RFID Localization Using Angle of Arrival Cluster Forming
RFID Localization Using Angle of Arrival Cluster Forming
继续阅读RFID Localization Using Angle of Arrival Cluster Forming
Python的asyncore模块提供了以异步的方式写入套接字服务的客户端和服务器的基础结构。
模块主要包括:
asyncore.loop(…) - 用于循环监听网络事件。loop()函数负责检测一个字典,字典中保存dispatcher的实例。
asyncore.dispatcher类 - 一个底层套接字对象的简单封装。这个类有少数由异步循环调用的,用来事件处理的函数。
dispatcher类中的writable()和readable()在检测到一个socket可以写入或者数据到达的时候被调用,并返回一个bool值,决定是否调用handle_read或者handle_write。
asyncore.dispatcher_with_send类 - 一个 dispatcher的子类,添加了简单的缓冲输出能力,对简单的客户端很有用。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
import time import asyncore import socket import threading class EchoHandler(asyncore.dispatcher_with_send): def handle_read(self): data = self.recv(1024) if data: self.send(data) class EchoServer(asyncore.dispatcher): def __init__(self, host, port): asyncore.dispatcher.__init__(self) self.create_socket(socket.AF_INET, socket.SOCK_STREAM) self.set_reuse_addr() self.bind((host, port)) self.listen(5) def handle_accept(self): conn, addr = self.accept() print 'Incoming connection from %s' % repr(addr) self.handler = EchoHandler(conn) class EchoClient(asyncore.dispatcher): def __init__(self, host, port): asyncore.dispatcher.__init__(self) self.messages = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] self.create_socket(socket.AF_INET, socket.SOCK_STREAM) self.connect((host, port)) def handle_connect(self): pass def handle_close(self): self.close() def handle_read(self): print self.recv(1024) def writable(self): return (len(self.messages) > 0) def handle_write(self): if len(self.messages) > 0: self.send(self.messages.pop(0)) class EchoServerThread(threading.Thread): def __init__(self): threading.Thread.__init__(self) def run(self): server = EchoServer('localhost', 9999) asyncore.loop() class EchoClientThread(threading.Thread): def __init__(self): threading.Thread.__init__(self) def run(self): client = EchoClient('localhost', 9999) asyncore.loop() EchoServerThread().start() time.sleep(2) EchoClientThread().start() |
SYS/BIOS (TI-RTOS Kernel) v6.50
ArrayTrack: A Fine-Grained Indoor Location System
定点浮点数
TI芯片上FFT转换计算相关。
Implementing Fast Fourier Transform Algorithms of Real-Valued Sequences With the TMS320 DSP Platform
1.Abstract
前些天借用他人的一块MCS-51开发板来做实验,不想这块板子与我刚开始接触MCS-51的板子一样,实在是太亲切了!现在回过来看这块板子,功能算不上是太强大,麻雀虽小五脏俱全,该有的功能都有。于是又忍不住捣腾这块板子,倒不是写小程序一块,看着电路图,到处连线测试一下功能,从中体会下最初的学习兴奋感觉。
最初板子里边最难学会的有两处,一处是由I2C上挂上的一些器件,另外一处是基于DS18B20的一线传输协议,当初花了好大气力去学习,仍旧一头雾水的情景仍记忆犹新。现在回过来看,觉得当时最大的问题是不注重对时序的分析,不能完全理解总线传输协议,毕竟理解是随着时间的增加而逐步深刻的。看到这两大部分,虽然是几个小小的芯片,但心底有不少的辛酸感。现在的理解也不能算完全,我想尽可能的用现在的所学将这两大部分分别写下来,权当是一个巩固学习的过程。
铁电存储器FRAM
手机上已经安装了手机淘宝的APP,或者有天猫店铺网店的页面,比如飞歌导航的官网,如果Firefox打开这个网页,就会自动启动手机淘宝APP,导致整个系统非常卡顿。
下面我们看如何关闭这个功能,如下图: