Set the port settings before open in the examples

Change-Id: I946a3f1d3a64a9b8c0d901347aa8ff5959ebc601
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>