Function not being called (noob question)

You are combining signed (int) and unsigned (uint16_t) types, this may cause problems. Please fix your "typeKey" function as mentioned above.