Adapt serial samples to additional API changes.

[open,close] -> [connect,disconnect]