Posts

Showing posts from October, 2013

Use readline library to built command line tools

Image
Use readline library to built command line tools Table of Contents 1 Why readline library? 2 How to use it? 1 Why readline library? As a Linux programmer, I always need to write some command line tools, with the help of GNU Readline library , this mission can be a snap. So what's the readline library gives for us, according to its official document? It provides a set of functions which allow users to edit command lines as they typed in. What's more, it also supports history recording and auto-completion. It is GNU software and is distributed under the terms of GPL license. 2 How to use it? I upload my source code, using the readline library, which implemented a silly command line tools with only two command inside – help and quit, but I can add another command easily in its framework. It support history recoding, which means you can browser the your command history by up/down keys, but it still cann't support command auto-completion(I will ad

How Bluetooth LE works? -- Link Layer

Image
How Bluetooth LE works? - Link layer Table of Contents 1 Bluetooth LE system architecture 2 Bluetooth LE Physical layer 3 Bluetooth LE Link Layer states 4 Bluetooth LE Link Layer packets 1 Bluetooth LE system architecture This is the first post and hopefully a series of upcoming postings about Bluetooth Low Energy. Above figure is the protocol stack of a whole Bluetooth LE system. The Bluetooth LE is one part of Bluetooth v4.0 specification, it was designed not to pursue high transmission speed but for lower energy consumption. So the Bluetooth LE products can be powered by a button-cell battery for years. How did it do that? This article is a review of Robin Heydon's excellent book – Bluetooth Low Energy, the developer's handbook. Bluetooth LE is completely redesigned of classic Bluetooth protocol, It seems that both the Bluetooth LE and classic Bluetooth has the same architecture from above figure, but actually they are so different inside, an

tts-mode for emacs update - support Mac OS X's tts engine

Image
tts-mode for emacs update - support Mac OS X's tts engine Table of Contents 1 Support Mac OS X's default tts engine 2 Configure and Install tts-mode 1 Support Mac OS X's default tts engine After I owned an Macbook air, I tried to port tts-mode into OS X system. I installed espeak command line tool into OS X, it works well just like in linux system. Thanks to the excellent portability of elisp source code, I need not to change any source code. I still have not installed festival tts engine into Mac OS, but it seems have many tutorials to do it. After that I found OS X's default tts engine, which provide an command line interface, has much clearer and greater fluency than both espeak and festival. So I wonder if I can support OS X's default tts engine. Then here it is, the new tts-mode . 2 Configure and Install tts-mode Reference the following codes: (add-to-list 'load-path "path/to/tts-mode" ) ;; configure tts engine'