[工作點滴] protocol buffer message

The statusapi.pb-c.h and statusapi.pb-c.c are generated. Only header file is printing here for further explaination. statusap.pb-c.h /* Generated by the protocol buffer compiler. DO NOT EDIT! */ #ifndef PROTOBUF_C_statusapi_2eproto__INCLUDED #define PROTOBUF_C_statusapi_2eproto__INCLUDED #include <google/protobuf-c/protobuf-c.h> PROTOBUF_C_BEGIN_DECLS typedef struct _Statusapi__StatusRequestType Statusapi__StatusRequestType; typedef struct _Statusapi__StatusResponseType Statusapi__StatusResponseType; typedef struct _Statusapi__StatusParams Statusapi__StatusParams; /* — enums — */ /* — messages — */ struct _Statusapi__StatusRequestType { ProtobufCMessage base; }; #define STATUSAPI__STATUS_REQUEST_TYPE__INIT \ { PROTOBUF_C_MESSAGE_INIT (&statusapi__status_request_type__descriptor) \ } struct _Statusapi__StatusResponseType { ProtobufCMessage base; }; #define STATUSAPI__STATUS_RESPONSE_TYPE__INIT \ { PROTOBUF_C_MESSAGE_INIT (&statusapi__status_response_type__descriptor) \ } ...

January 31, 2013 · 4 min · 779 words · ChenFu Kuo

[Work Notes] Protocol Buffer Examples

There is protobuf and protobuf-c website: http://code.google.com/p/protobuf/ http://code.google.com/p/protobuf-c/ We are implementing remote control from back-end applications using protobuf-c. The protobuf-c has extensions from Google’s protobuf for RPC functionality. The first experiment is using the message directly by packing messages into shared memory between the server and the client. Both sides can get the message without issues. Our target is to use the RPC approach that protobuf-c provides. First, we create a .proto file — here’s an example statusapi.proto: ...

January 30, 2013 · 2 min · 285 words · ChenFu Kuo

[Work Notes] Heading Toward Ten Years

While organizing earlier blog posts from 2008, I notice how immature I was back then — but looking at the transitions and broader experiences since, it seems I’ve grown, even if just a little. In January 2011, just before hitting my seventh year, I made a major decision: to leave a very familiar work environment. In some ways, it meant stepping out of my comfort zone — essentially resetting myself. What guided the decision was an unexpected opportunity to work at a multinational foreign company. That opportunity matched a few things I’d been thinking about: ...

January 29, 2013 · 3 min · 546 words · ChenFu Kuo

[Miscellaneous] Great BBQ in Neihu

In Neihu, there’s a great BBQ spot on the road in front of the main gate of Lishan Junior High School, near Gang-Qian Road. It’s called Chuan Men Zi BBQ (串門子燒烤) — pretty solid! There’s a bookstore next door. Hours are 17:00 to 24:00. You can call ahead to order and then pick up — it’s takeout only, not the kind of place you sit down with friends for a long chat. ...

July 4, 2008 · 1 min · 115 words · ChenFu Kuo

[Work Notes] ncftp-3.2.1 Cross-Compiling

ncftp is an FTP client. One of our projects needed FTP functionality, so I cross-compiled it for an ARM target. Build Steps Step 1: Generate the Makefile. If you need curses support, add the relevant library — but for our project it’s not needed: ./configure --disable-ccdv --without-curses --without-ncurse Step 2: Edit the Makefile — update CC and STRIP as follows: CROSS_COMPILE=arm-unknown-linux-gnu- CC=${CROSS_COMPILE}gcc STRIP=${CROSS_COMPILE}strip Step 3: Make it! make

March 3, 2008 · 1 min · 68 words · ChenFu Kuo

[Personal Reflections] A Married Man

In two more weeks, I’ll be getting married — the title says it all. “A married man” is simply the counterpart of “a married woman”! Marriage marks the beginning of a new chapter in life. Someone will be by my side, supporting me through everything. There will surely be much to learn and grow through — I hope I can do it well. 😄 Thank you to my other half for more than three years of companionship. I look forward to your continued guidance in the days ahead.

December 23, 2007 · 1 min · 88 words · ChenFu Kuo

[Work Notes] A Good Article on the Surveillance Industry

While searching for information online recently, I stumbled upon a blog discussing articles about the security and surveillance industry. It was quite unique — it’s rare to find blogs specifically covering this niche industry. Through Andy’s articles, I also made a new connection and shared some thoughts. Blog link: http://febon.blogspot.com/ If you’re interested in the security surveillance industry, feel free to drop by and join the discussion.

December 23, 2007 · 1 min · 67 words · ChenFu Kuo

[Work Notes] Eclipse IDE under Ubuntu

Most of the following content is adapted from online resources, with some corrections based on issues I encountered during setup. Ubuntu’s default Java environment uses GCJ-1.4, which has poorer performance. So the first step is to install the following packages using your preferred package manager (on Ubuntu, go to System → Synaptic Package Manager): sun-java6-jre (required environment for running Java software) sun-java6-jdk (needed only if you are a Java developer) eclipse-jdt (Eclipse’s Java Development Tools package) eclipse-common-nls (Eclipse’s localized language messages — install this for a Chinese interface) galternatives (GUI frontend for update-alternatives, used to change system default preferences) Edit the following file: vim /etc/jvm ...

December 10, 2007 · 2 min · 356 words · ChenFu Kuo

[Work Notes] Live555 Streaming Server "config.armlinux" Fix

The following lines in red need to be modified; otherwise you’ll get a flood of errors during linking: CROSS_COMPILE= arm-unknown-linux-gnu- COMPILE_OPTS = $(INCLUDES) -I. -O2 -DSOCKLEN_T=socklen_t -DNO_STRSTREAM=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 C = c C_COMPILER = $(CROSS_COMPILE)gcc C_FLAGS = $(COMPILE_OPTS) CPP = cpp CPLUSPLUS_COMPILER = $(CROSS_COMPILE)g++ CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1 OBJ = o LINK = $(CROSS_COMPILE)g++ -o LINK_OPTS = -L. CONSOLE_LINK_OPTS = $(LINK_OPTS) LIBRARY_LINK = $(CROSS_COMPILE)ld -o LIBRARY_LINK_OPTS = $(LINK_OPTS) -r -Bstatic LIB_SUFFIX = a LIBS_FOR_CONSOLE_APPLICATION = LIBS_FOR_GUI_APPLICATION = EXE =

November 21, 2007 · 1 min · 80 words · ChenFu Kuo

[Work Notes] The Choice Between Knowing and Not Knowing

Recently, in the process of constantly trying new things — combined with ever-changing work assignments — I’ve started running an experiment of sorts: does a person need to fully understand something before they can accomplish the work? From my observation so far, the answer is: you don’t need to fully understand in order to get something done. However, that’s a short-term view. From a long-term perspective, the hidden costs of not knowing can be just as significant — sometimes even worse. ...

November 13, 2007 · 1 min · 200 words · ChenFu Kuo