use enum for state in EmbeddedChannel
Merge remote-tracking branch: upstream/master