erlang基础实例代码:http://www.cnblogs.com/itfreer/gen_fsm学习:http://blog.sina.com.cn/s/blog_96b8a1540101ef7g.html