add Service Application support
add log support for smsgd
reformat raw-serial code